Stubborn movieClips

Okay,
I making a cartoon. In the beginning, I make a static, ordinary starfield. Instead of just drawing it in the first layer (which I will do if I need to); I duplicate the one movieClip about 200 times and scatter them all over the stage. All this works great.

My problem is when I go to the next scene, the stars from the first scene remain. I don’t understand how they are staying, because the layer is gone in the next scene, but they are.

Any ideas why?

Hi,
I assume that you are using duplicateMovieClip, if it is on the main time line it will be present throughout the movie, you need to place the code inside a movieclip in order to confine it.
Recently I had a similar problem myself with daisies ( yes I did),
Another (and I think better) method is to place a blank mc on stage and use attachMovie code, just make sure that the mc you are attaching/duplicating has a linkage identifier

Hope that helps

SteveD

Can you post your code?

– Anyway, why don’t you duplicate all the stars in one container clip, and then delete that clip when you change scene?

Thats more or less what I meant, but I need so many more words than you ilya - hope I didn’t confuse anyone

SteveD

C’est Ilyas :slight_smile:

Thanks guys!
Usually when I do duplicateMovieClip, I do it from an empty MC on the side. It has always worked, but I thought I was doing it wrong. I guess the wrong way wound up right…right?

Whew, that’s hard to say.

My duplicateMovieClip code IS on the main timeline. I will move it to another MC and it will work fine. I can still tell you my code if you want, but I’m sure you’ve seen it all before.

Thanx guys!!
(-:

Okay, still have the problem.

I put the dupMC code in an empty MC off the stage, but the stars still remains. I figured I could use some code like:
this.removeMovieClip();, but I don’t know where to put it so it will apply to all the MCs on the stage.

I also, rereading the posts from before, don’t quite understand how to use attachMovieClip yet.

I hope someone can help…
Boo…
:*(

Hi,
Take a look at this fla, if it is the effect you are trying to achieve the code you need is on fr1 of mc.symbol22

Hope it helps

SteveD

Interesting way to do it. A little confusing at first, but I got it and it works. Thank you!!
I don’t know if you read this or not before I edited it, it works perfectly. I had _x/_y AS on the old MC from before. Teehee.
Fixed it - everyone wins!
(-:

I’m actually tinkering with this Snow Tutorial now, and I’m having the same problem. However, what was mentioned makes no sense to me. I’m a flash newbie, but I like to know what’s going on than just getting it to work right. If anyone can explain that a little bit better, has time to take with me to explain how to modify it to what I need or something, I’d really appreciate it. Basically right now playing with it and trying to know it and all. Thank you.

Note: Just attaching my file in case for whatever reason. Thanks.

Hello,

Alright, I’ve attached the fla that works - but I admire your thirst for knowledge and the want to know ‘how’!! (I’m tired and kinda babbling, sorry)

These were the changes made:

  1. on your movieClip ‘snow’, you have to put the duplicateMovieClip actions from the main timeline to the timeline of the movieClip itself. This is what I mean. If you double click on the movieClip ‘snow’, you will see that there is another movieClip inside of it with a new layer called ‘actions’. That movieClip is simply the same thing as ‘snow’ - it’s just inside ‘snow’ - its new name is ‘newMovieClip’, which is the one we’ll duplicate.

  2. The actions from the main timeline, that are now in the movieClip ‘snow’, need to be redirected to the newMovieClip. So your code goes from this:
    [AS]
    for (k=0; k<50; k++) {
    duplicateMovieClip(_root.snow, “snow”+k, k);
    }
    //on the main timeline to this:
    for (k=0; k<50; k++){
    duplicateMovieClip(_root.snow.newMovieClip, “snow”+k, k);
    }
    //on the snow movieClip timeline.
    [/AS]

  3. Then we move the actions that were on ‘snow’ to ‘newMovieClip’ that’s inside ‘snow’.

  4. The last thing I had to do was move the movieClip ‘snow’ to the top left corner of the stage because with your actions nested inside of that movieClip, they now respond to that movieClip as 0,0. To see what I mean, move the movieClip ‘snow’ to the center of the stage and test the movie. All your snow will be misaligned.

Well, there you have it. It’s kind of a confusing thing. I didn’t really get it right away back there in April, but I think I have a handle on it now. If you have actions on the _root (main) timeline, especially the drawing API - they will be there for the duration of the movie. I hope I helped!!