Hi All,

 

I am trying to play sound by the using of following sample code from help:

 

Its not playing sound any more. I have already mp3 files in my application directory.

 

Is this bug?

 

Can anyone confirm it?

 

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml">
 
    <mx:Script>
        <![CDATA[
        
            import flash.media.*; 
        
            [Embed(source="mySound.mp3")]
            public var sndCls:Class;
            
            public var snd:flash.media.Sound = new sndCls(); 
            public var sndChannel:SoundChannel;
            
            public function playSound():void {
                 sndChannel=snd.play();
             }    
             public function stopSound():void {
                 sndChannel.stop();
             }    
        ]]>
    </mx:Script>
 
    <mx:HBox>
        <mx:Button label="play" click="playSound();"/>
        <mx:Button label="stop" click="stopSound();"/>
    </mx:HBox>
</mx:Application>

 

 

 

With Regards,

 

Ritesh Jariwala (Actkid)

Freelance Developer

www.actkid.com

Company: www.synonymic.com

 

 

 

 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to