| Member List |
| Posted: 02 Jul 2008 07:46 | ||
|
Registered User Currently Offline |
Posts: 1 Join Date: Jul 2008 |
|
|
Hi guys,
could u tell me whats wrong with this code please,it's just to load and play a song knowing that the directory of the song is correct,when i compile it doesnt read it and i dont get the message mp3 loaded in my console. i'm using flex 3. package { import flash.display.MovieClip; import flash.events.Event; import flash.events.IOErrorEvent; import flash.media.Sound; import flash.net.URLRequest; public class Audio1 extends MovieClip { public var sound:Sound; public function Audio1() { sound = new Sound(); var request:URLRequest = new URLRequest("Audio1/Audio1/demo.mp3"); sound.load(request); sound.addEventListener(Event.COMPLETE, onLoad); sound.addEventListener(IOErrorEvent.IO_ERROR, onIOError); sound.play(); } private function onLoad(event:Event):void { trace("mp3 loaded"); } private function onIOError(event:IOErrorEvent):void {} } } |
||