Development Flex


    
    xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx">
     
         
        import flash.media.*; 
        [Embed(source="sample.mp3")] 
        [Bindable] 
        public var sndCls:Class; 
        public var snd:Sound = new sndCls() as Sound; 
        public var sndChannel:SoundChannel; 
        public function playSound():void { 
            sndChannel=snd.play(); 
        } 
        public function stopSound():void { 
            sndChannel.stop(); 
        }