FORUMS: list search recent posts

Nesting Movie Clips

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jenn Sager
Nesting Movie Clips
on Feb 18, 2009 at 7:19:23 pm

I'm using Action Script 2.0 and I had this question about movie clips..

I want to make an opening of a SWF with butterflies flying around. A user will be able to click any of the butterflies and ALL of them will 'fly away' off screen.

So far this is what I have..

A movie clip with a 'flapping' butterfly.
A movie clip with the flapping butterfly with a gotoAndPlay (2) AS. Frame 2 has a motion tween of a butterfly 'flying away'
The last movie clip is of the 'fly away' butterfly following a motion path.

Once the flight path MC is on a scene, it all works fine, except, once clicked, the butterfly 'flies away' and continues on the flight path again. I don't want this to happen, want it to simply stop at that point. Even with a stop (); at the end of the 'fly away' MC, it doesn't. I know I'm missing something with nested files.

Also, I'm pretty much clueless on how to command other movie clips by clicking one movie clip (as in you click on one butterfly and they ALL 'fly away')

Any help would be appreciated, thanks!

Jenn
jenn.sager@gmail.com


Return to posts index

Graham Quince
Re: Nesting Movie Clips
on Feb 19, 2009 at 8:59:54 am

To make all the butterflies fly away on one click, the easiest method is to give them all an instance name:

butterfly1, butterfly2 etc...

Then on your button function use the following:

for (i=1; i<=10; i++) {
_root["butterfly"+i].gotoAndPlay(2);
}

This code works for 10 butterflies, if you have more simply increase the i<=10 value. Flash will run the same action for every instance of of your butterfly movieclip.

As for your butterfly clip not stopping...First off copy your movieclip to its own flash movie, and dump the button press, just have it run. Does it stop now?

If yes, then it is probably something to do with the button command, could you be pressing on more than one butterfly?

If no, shove two trace("test this"; on the same frame as your stop(); action, one above and one below. What happens when the movieclip runs.

Is your action on its own unique keyframe? Or does it share he frame with anything else? Is it definetly on the same timeline as your motion tween?

Graham

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films


Return to posts index

Jenn Sager
Re: Nesting Movie Clips
on Feb 19, 2009 at 6:51:27 pm

Still not working.. I will click on the butterfly, it flies off of the path (as if flying away) and then starts the motion path all over again. The second time its on the path, the butterfly is no longer clickable. I think the problem is that I have the 'fly away' MC inside the motion path MC. So, if the parent MC is doing its job, it should loop through everything, which it does. Question is.. how do I stop the parent MC from looping after the child MC has been activated? I'm new to Creative Cow and I'm not sure how, but I'd like to upload my FLA file so someone can take a look at it?

Thanks!
Jenn


Return to posts index


Graham Quince
Re: Nesting Movie Clips
on Feb 20, 2009 at 8:32:14 am

Ah, i think I can see what you're doing, I'll happily take a look if you want to email me your fla to graham_quince at hotmail.com and I'll see if I can work it out.

What I think is happening is your movieclip is going to its stop frame then holding on that last frame which contains a separate movieclip of your butterfly flying off. Trouble is your 'fly away' MC may not have its own stop action, so it just keeps looping and depending where your button code is, this 'fly away' MC may not have a command on it.

Graham

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]