Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Nested MovieClips

Sign in to follow this  


One of the cool things about Flash is that you can nest MovieClips within one another, and each MovieClip behaves essentially like it's own subprogram, and runs its own code in response to events that it receives.

The downside is that when you put MovieClips inside of other MovieClips, timing issues come up. Your MovieClip gets the onLoad event, but this doesn't mean that all of the nested MovieClips are loaded, and I have found that they never are.

So, what I do is have the leaf MovieClips (the ones with no children MovieClips) tell their parent when they have loaded. The parent then determines when all of its children have loaded, and when they have, it notifies its own parent, and so on down the chain, until the main object knows that everything has been loaded, and that it is safe to use all MovieClips.

It sort of has the same feeling as multi-threaded code, but only for loading MovieClips. The rest of the time, I can use the objects normally.

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!