flashcs.org

7 05 2007

Hi all i have just launched flashcs.org… this is for anyone who has found this site useful and want some more help.

Check it out >>





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
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19435