Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn on/off Bg music

Status
Not open for further replies.

kwasiada

Technical User
Jan 5, 2005
14
GB
Hi guys

I'm using AS2
I have a movie with Bg music playing
I need to silence music when I enter my video section & turn back on when I leave
At the moment it does those things but when I enter another section it adds another instance of Bg music

This initialises the Bg music
Code:
onEnterFrame = function() {
bgSound = new Sound(this);
bgSound.attachSound("sound9");
bgSound.start(0, 99);
delete this.onEnterFrame;
}
This turns it off (myPlayer is flv playback component)
Code:
myPlayer.onEnterFrame = function(){
	    _root.bgSound.stop();
	delete this.onEnterFrame;
}
This turns it back on (clip event on component)
Code:
onClipEvent(unload){
      _root.bgSound.start(0,99);
}

I can't get setVolume to affect the music.
Any help is much appreciated

Peace
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top