I think I am nearly there with creating a flash presentation player with audio control but have a slight problem that i’m sure can be tweaked to work with my PLAY/PAUSE button. Hopefully a quick fix for someone who knows more than me.
The set up is a different mc on each frame of the timeline. each mc has an audio narration file dynamically loaded with attachSound. I have a play/pause button (mc) on the first mc frame with the following code:
Frame 1
on (release) {
myMusicPosition = _root.sound1.position/1000;
_root.sound1.stop(“introduction_snd”);
gotoAndStop(2);
_root.mc_clip1.stop();
}
Frame 2
on (release) {
_root.sound1.start(myMusicPosition, 0);
gotoAndStop(1);
_root.mc_clip1.play();
}
This works great, when i press the pause button the animation AND sound both pause and again both resume when i press play.
The problem occurs on frame 2 of the main timeline. I repeat the code and change the mc instance name and sound name accordingly but it only pauses the animation, the audio continues. See below for my play/pause button code for main timeline frame 2.
Frame 1
on (release) {
myMusicPosition2 = _root.sound2.position/1000;
_root.sound2.stop(“kluge_story_snd”);
gotoAndStop(2);
_root.mc_clip2.stop();
}
Frame 2
on (release) {
_root.sound2.start(myMusicPosition2, 0);
gotoAndStop(1);
_root.mc_clip2.play();
}
I think the problem maybe something to do with the “myMusicPosition”, because i’m not exactly how this part works and so thought i would name it “2” in the AS to diffrientiate it from the first button code.
This is kinda hard to explain but i really hope someone can help figure this out.
Thanks.