Thanks, maybe it's just that I'm used to the quirks of AS2 and am still getting up to speed on the OOP of AS3.
So, since I had some places where there were 2 audio files playing (background music over several narration pieces) and the fact that I have f4v files with and without audio, I ended up hard-coding everything with a new sound instance and channel for each audio file. Something like:
and each video file is handled like:Code:var s2_1:Sound = new Sound(new URLRequest("audio/Slide2.mp3")); var my_channel2_1:SoundChannel = new SoundChannel(); my_channel2_1 = s2_1.play(); my_channel2_1.addEventListener(Event.SOUND_COMPLETE, goNext2_1); function goNext2_1(myevent:Event):void { s2_1.removeEventListener(Event.SOUND_COMPLETE, goNext2_1); this.play(); }
So, that's all working fine, although it's a pain to update...HOWEVER, now I have to get the play/pause button to work and, somehow, I need to know if it's currently playing an audio or video file...I suppose I can set a variable with the name(s) of the existing element on the screen so it will know if it's a video or audio piece being played...although, that's going to be a pain to go back and add in...Code:video3_flv.addEventListener(VideoEvent.COMPLETE, onComplete); function onComplete(evt:VideoEvent) { this.play(); } video3_flv.addEventListener(Event.REMOVED_FROM_STAGE, cleanUp); function cleanUp(e:Event) { e.target.stop(); e.target.removeEventListener(VideoEvent.COMPLETE, onComplete); e.target.removeEventListener(Event.REMOVED_FROM_STAGE, cleanUp); }
ugg...
![]()




Reply With Quote