Haven't had an Error 1009 issue in awhile but tonight I got one trying to play an external .mp3 track. Seems i got a null object somewhere but I can't seem to locate it. After debugging, it seems to be an error in my playBtn reference but it seems have all the proper instances. Any idea where the problem may lie?
Here's the code:
Code:import flash.media.SoundChannel; stop(); pauseBtn.visible = false; var snd:Sound = new Sound(); var myChannel:SoundChannel = new SoundChannel(); var lastPosition:Number = 0; snd.load(new URLRequest("someAudio.mp3")); pauseBtn.addEventListener(MouseEvent.CLICK, onClickPause); function onClickPause(e:MouseEvent):void { lastPosition = myChannel.position; myChannel.stop(); pauseBtn.visible = false; playBtn.visible = true; } playBtn.addEventListener(MouseEvent.CLICK, onClickPlay); function onClickPlay(e:MouseEvent):void { myChannel = snd.play(lastPosition); pauseBtn.visible = true; playBtn.visible = false; }




Reply With Quote
