Movieclip within another movieclip

13 posts

Flag Post

Lets say I have movieclip movieA within movieclip movieB. a has multiple frames so I want to stop it from playing. So I use this from my main timeline.

movieB.movieA.stop();

The compiler then complains that the term is undefined and has no properties. How can I prevent this from happening? Of course I could just avoid putting movieclips inside other movieclips and use workarounds like the visible property but there must be a simple way to work around this problem.

 
Flag Post

Have you given movieA an instance name within movieB?

 
Flag Post

Yes I have. So this error occurs when it cant find the name? Movieclip A isnt on the first frame in movieclip B, could that be causing the problem?

 
Flag Post
Originally posted by MilkingTheCowMOO:

Yes I have. So this error occurs when it cant find the name? Movieclip A isnt on the first frame in movieclip B, could that be causing the problem?

I’m not sure, maybe you can ask your grand-grand-grand son?
He can tell you. What’s that you say? he doesn’t exist yet?

 
Flag Post

Put movieclip A on the first frame and set its visibility to false until you need to show it. Problem solved.

 
Flag Post

Ok thanks for your help all. I got it working now. But does this also mean that when I have eventlisteners on A and I have 4 layers on B that A has to be on the stage on all 4 frames, be it visible or invisible?. Im quite new to all this and all this movieclip inception is by far the most confusing thing for me.

 
Flag Post
Originally posted by MilkingTheCowMOO:

Ok thanks for your help all. I got it working now. But does this also mean that when I have eventlisteners on A and I have 4 layers on B that A has to be on the stage on all 4 frames, be it visible or invisible?. Im quite new to all this and all this movieclip inception is by far the most confusing thing for me.

Layers != Frames

Fix that and I’ll know what you’re trying to say and can answer your question.

 
Flag Post

Yeah sorry I meant 4 frames.

But I figured it out now. My error was caused because I have a click redirecting to another frame of B, mouse_over and and mouse_out on my movieclip A. when I click on it my mouse_out will error on me probably because movieclip A isnt there anymore to process the action so I still have to add and invisible A on frame 3 I guess.
Am I the only that finds movieclips annoying to work with or is it just my lack of experience?

 
Flag Post

They only get complicated if you try to manage everything with timeline code or some giganormous frankenclass instead of breaking things up into individual classes.

 
Flag Post
Originally posted by MilkingTheCowMOO:


Am I the only that finds movieclips annoying to work with or is it just my lack of experience?

I’d say it’s lack of understanding, which besides being related to yor lack of experience, it may also be the result of bad practices like using frames, layers, timeline code, etc. It’s one of the many issues that arise when a newbie uses Adobe’s IDE: you think of objects as visual representations which you drag around and manually move to change its position from frame to frame; you think your application is nothing but a bunch of graphics moving around on the “screen”.

Try to get rid of those bad habits now that you’re just starting; one frame, no objects on the stage (well, one object, since you use AS2 and that’s a way to emulate the doc class) and use classes.

 
Flag Post

I actually use 1 frame on the main timeline but My movieclips contain multiple frames. And I use AS3.

 
Flag Post
Originally posted by MilkingTheCowMOO:

I actually use 1 frame on the main timeline but My movieclips contain multiple frames. And I use AS3.

Frames are for when an object is visually different but functionally the same.

E.g. a play/pause button. The same object does the “same” thing (interacts with an audio/video source) but needs to visually indicate it’s state, so one frame is a little play button, the other is a little pause button.

 
Flag Post

For anyone that might encounter the same problem. Working with multiple frames in a movieclip is absolutely horrible. I’ve reduced the movieclip to 1 frame and just pasted the screens of the deleted frames next to the other screens. Now I go to another background by changing the x and y values of the movieclip.

The next project I’ll use classes though.