This content has been marked as final. Show 4 replies
is this a hard question?
No, Put this code in a function. and then call that function to play this sound.
When an app starts up, only variable definitions are excuted by default in <Script> tags. You need to put the sound in a function, and have the function called when some event is dispatched, such as creationComplete.
"ChicoNERD" <firstname.lastname@example.org> wrote in message
> As you can see, this is a very simple code to play a sound.
> however it is not working, i don't see any reason why is not working but
> says that play is not a property of snd.
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
> <mx:Panel width="300" height="150" title="MP3 Player">
> var snd:Sound = new Sound(new URLRequest("smallSound.mp3"));
Youi can't issue function calls unless you're within a function.