MovieClipLoader : documentation

October 19th, 2006 . by polyGeek

The MovieClipLoader class rocks but I wish MM/Adobe would have documented it a little better. I was pulling my hair out over one of those issues where you keep saying, “but, it should work” only to find out that no, it shouldn’t work because the class does certain things without telling you.

First off it resets certain settings, like _visibility. If you have a MovieClip with its _visibility set to false and then use the MovieClipLoader class to load a file into it then the _visibility gets reset back to true. Thank you, it would have been nice to put that in the help files. Now it simple enough to work around that. Simply use the onLoadInit, which I was using anyway, to set the MovieClip’s _visibility to false.

To add to this oddity the _alpha doesn’t get reset. Go figure.

You can also count on any dynamic properties being wiped out. If you have a MovieClip, lets call it “mc“, with a dynamic property such as mc.myName = “Dan”. And then you use the MovieClipLoader class to load a file it will delete all those dynamic properties.

The second issue is how it handles attachMovie. If you load a file via MCL and then try to use attachMovie to attach a linked MovieClip in your library it won’t work. However, you can attach MovieClips from the loaded SWF to itself but only to itself and not to another MovieClip.

For instance, if you create a MovieClip, we’ll call it holder, and then use the MCL to load a SWF that has a linked MovieClip in its library, lets call it circle, then you can attach the circle MovieClip to holder after it has loaded but you can’t attach circle to something like the _root or any other MovieClip. It sort of like scope for MovieClip libraries.

It would be great if someone who really knows why/how the MovieClipLoader class works would write up a detailed documentation on it.

Bottom line, if you’re using the MovieClipLoader class and things aren’t working the way you might expect then consider that it’s a feature of the class, and not a problem with your code.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Digg
  • Facebook

Leave a Reply

Name

Mail (never published)

Website

- Why ask? This confirms you are a human user!

   




© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites