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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove movie clips 1

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I have set up 2 buttons that load in different movie clips.
I am positioning these movie clips in different positions.
I am not sure how to unload them or removeMovieClip.

This is how I loaded the movie clips:
Code:
button1_mc.onRelease = function() {
   loadMovieNum("FirstMovie.swf", 1);
   loadMovieNum("SecondMovie.swf", 2);
   this.onEnterFrame = function() {
       _level1._x = 60;
   };
};
button2_mc.onRelease = function() {
   loadMovieNum("FirstMovie.swf", 1);
   loadMovieNum("SecondMovie.swf", 2);
   this.onEnterFrame = function() {
       _level1._x = 100;
   };
};
 
First you're not really loading movie clips... You're loading external .swfs on levels...
Second, IMHO, my suggestion to pre-position the loaded movies within themselves, was a better solution... Expecially in view that you're not deleting the enterFrame when it's no longer needed.

As for unloading movies loaded on levels, it's not a must if you're loading other movies on the same levels, as the previous movies will automatically be cleared when loading the new movies...

If you're not loading other movies, you can unload them with...

unloadMovieNum(1); // 1 being level 1...

On a button...

on(release){
unloadMovieNum(2); // 2 being level 2...
}




Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Howdy oldnewbie,
Thanks for the lesson. I am new to ActionScript and I am not sure of the correct terminology (lingo).

Only reason I thought I had to unload a movieclip is that my _level1._x is different on both buttons.
It defaults the _x value that runs first based on the button I click on first.
I am not sure why my _x value is not moving my movieclip when I flip between movieclips?
 
Why are you loading both movies on both buttons?

button1_mc.onRelease = function() {
unloadMovieNum(2);
loadMovieNum("FirstMovie.swf", 1);
};

button2_mc.onRelease = function() {
unloadMovieNum(1);
loadMovieNum("SecondMovie.swf", 2);
};

On the FirstMovie's first frame...

this._x = 60;
this._y = 100; // if necessary...

On the SecondMovie's first frame...

this._x = 100;
this._y = 50; // if necessary...

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Howdy oldnewbie,

Star to you.
I am changing my code to what you specified of setting the location of the swf in the first frame of the timeline for each swf.

I should of put the following code:
Code:
button1_mc.onRelease = function() {
   loadMovieNum("FirstMovie.swf", 1);
   loadMovieNum("FirstSlideshow.swf", 2);
 
};
button2_mc.onRelease = function() {
   loadMovieNum("FirstMovie.swf", 1);
   loadMovieNum("SecondSlideshow.swf", 2);
};

Since you said that if I load movie into an existing layer, previous movies will be automatically cleared.
Thanks again.
 
Opps, I forgot to give you a star Oldnewbie.
Star to you.

Thanks again,
ksbigfoot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top