Again, how peculiar. I'd love to take a look at the internals of
MovieClip and Flash's loader system to see what's causing that
particular glitch!

Cheers,
 Ian

On 8/24/06, Chris Allen <[EMAIL PROTECTED]> wrote:
Okay,

I have fixed the problem. I would say that this is certainly bug with
Flash, but there is a work around. Thanks to Keith Peters for
mentioning this to me last night.

So here's the deal... Back in the day before MovieClipLoader when you
wanted to load and external SWF, you had to check a property of the
MovieClip to see if it existed before you could manipulate it. You
needed to create an interval that would check to see if it's
initialized in this way. This all makes sense to me, but what doesn't,
is that you can't just check that any property of MovieClip was set.
There is a magic property that seems to indicate that the MovieClip is
fully initialized. That property is _width.

So with this in mind I added a check to the onLoadProgress event like so:

private function handleLoadProgress(targetMC:MovieClip,
loadedBytes:Number, totalBytes:Number):Void
        {
                if (MovieAsset.HIDE_WHEN_LOADED)
                {
                        if (targetMC._width != undefined || targetMC._width != 
0)
                        {
                                targetMC._visible = false;
                        }
                }
}

Now, how's that for obscure? It does fix the issue, and instanceof is
indeed a MovieClip once again. Oh, and even better, _visible works
like a charm.

Thanks again to all those that helped out with this one.

-Chris

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to