removeMovieClip() dosent work – flash 6 work around

17 11 2006

So it would seem that when you publish your movies in flash 6, removeMovieClip() doesn’t seem to work properly or at all.

This is because you are more than likely using getNextHighestDepth() which is supposably perfectly fine. But in certain cases such as using v2.0 components or buttons this will cause problems. The reason is that when you use components the Flash DepthManager class automatically reserves the highest upper and lower depths available to Flash (-16383,1048575). So if you have a component in your fla and you call getNextHighestDepth() it will return 1048576 – this is now an out of range depth for removeMovieClip() making it unable to remove the clip. Also the call will fail silently (making it hard to debug)


Work Around Provide by macromedia

Use unLoadMovie() instead ofremoveMovieClip(). – I still have problems, but it might work for you.

Swap the depth of the movie clip to a level at or below 1048575 before doing removeMovieClip() – With a complicated movie can get interesting to sort sometimes


The easiest way I have found is to manage the depths manually, this approach is extremely easy and doesn’t cause any issues

var nDepth:Number = 100
var createEmptyMovieClip(“myClip_mc”, nDepth++);

Hope this shines some light on what can be an extremely frustrating problem.


Read some more about it here




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: