Hi everyone. I’ll try to make this as brief as possible. I am creating a flash project which contains video on a few pages. The project also contains background music which loops contiuously.
The goal is to have the background music stop whenever the user is on a page containing video and for the music to play again when the user leaves said page.
The script I created works to stop the music, but it also stops the audio contained within the video and causes the video player (by proxxus) to lock up.
The solution is probably a simple one, but I’m having difficulty figuring it out.
If anybody can see where I’ve gone wrong, your help would be greatly appreciated. Here’s the setup:
Library:
music.wav - linkage = “myMusic01”
Main Timeline:
//-- create a variable to determine if the current movie contains video
var currMovie:String = "notVideo";
//-- start playing sound object
myMusicMc.myMusic.start(0, 999);
myMusicMc (residing on main timeline)
frame 1
//-- set up sound object
myMusic=new Sound();
myMusic.attachSound("myMusic01");
frame 2
//-- check the variable "currMovie"
if (_root.currMovie == "Video") {
_root.myMusicMc.myMusic.stop();
} else {
_root.myMusicMc.myMusic.play();
}
frame 3
//-- create a loop to continuously check the variable
gotoAndPlay(2);
on the actions layer of the movie clip containing my navigation controls
snippet of the callback used
videoLink_mc.onRelease = function() {
_parent.prodDetail_mc.gotoAndPlay("video");
_root.currMovie="Video";
}
on all the other buttons currMovie is set to “notVideo”