Question : How do you detach a movie clip when any action causes the movie to go to any other frame?

I'm modifying a flash template. It has these 'read more' sections. I've coded a little music player movie clip that gets attached on a read more page, but it stays attached whenever I leave the read more section and go somewhere else. It stays in place on top of everything. I guess I just need to have it detach on some kind of event like moving to another frame.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function reloadContent() {
	thisTitle.htmlText=_root.readMoreTitle;
	thisText.htmlText=_root.readMoreText;
	sampleText.htmlText=_root.readMoreSampleText;
	_root.textSelectable(thisText);
	_root.textSelectable(thisTitle);
	_root.textSelectable(sampleTest);
	
	//if (_root.isAlbumPage == "true")
	//{
		trace("blah");
		this.attachMovie("musicPlayer", "musicPlayer_mc", 1000);
		this.musicPlayer_mc._x = "601.0";
		this.musicPlayer_mc._y = "190.0";
		this.musicPlayer_mc._width = "249.0";
		this.musicPlayer_mc._height = "410.0";
		trace(musicPlayer_mc._x);
	//}
}
Open in New Window Select All

Answer : How do you detach a movie clip when any action causes the movie to go to any other frame?

Ok...got it worked out for you now. I'm a dope for not saying this before, when you attach the movie to "this" it attaches it to the stage. I created a blank clip called blank and attached it to that. Also, your button wasn't being tracked as a button so none of the commands were being passed. It's attached.
1:
2:
3:
4:
5:
6:
7:
8:
9:
BUTTON:
on (release) {
	blank.unloadMovie("myRectangle_mc");
}
 
FRAME1:
blank.attachMovie("myRectangle", "myRectangle_mc", 100);
blank.myRectangle_mc._x = "100";
blank.myRectangle_mc._y = "100";
Open in New Window Select All
 
 
Random Solutions  
 
programming4us programming4us