2 Replies Latest reply on Jul 27, 2006 7:27 AM by ddanone

    SoundEffect doesnt works in AS

    ddanone Level 1
      Why this sample does not works?

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[

      import mx.effects.SoundEffect;

      [Embed(source="sound.mp3")]
      public var sndObj:Class;

      public function snd():void{

      var snd:SoundEffect=new SoundEffect();
      snd.source=sndObj;
      snd.duration = 5000;
      snd.play();
      }

      ]]>
      </mx:Script>

      <mx:Button label='Sound' click='snd()'/>

      </mx:Application>