Would UIObject.doLater() be of any use?

>From the docs:
"Method; calls a user-defined function only after the component has finished
setting all of its properties from the Property inspector or Component
inspector. All version 2 components that inherit from UIObject have the
doLater() method."

Adrian

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Adrian
Lynch
Sent: 22 January 2006 13:04
To: Flashcoders
Subject: [Flashcoders] Duplicating MC with Loader inside


I knew of an initialisation problem with nested Loaders from another project
I did. Back then I didn't look too much in to it but this time I want to see
if I can find a solution.

Here's what I have and what I'm doing/trying to do:

- I have an MC on stage, inside this is a Loader component.

- I duplicate this MC, and hence the Loader inside it.

- I then set the properties' of the duped MC's Loader, contentPath and
scaleContent, and then call it's load() method.

If I do the above in sequence, the duped MC's Loader isn't initialised by
the time I try to set it's properties'.

If I delay using the duped MC's Loader, and instead fire an event that does
it, a button click for example, the Loader works fine.

I can think of two solutions, but I'm not too sure about them.

1. Set an interval to give the Loader time to get ready and then set the
properties.

2. Do the duping, check using an onEnterFrame to see if the nested Loaders
properties' exist and then set them.

The problem with 1 is, how long is long enough?

The problem with 2 is, will I get away with checking one property or will I
have to check them all? For example, I can check to see that contentPath is
difined, but what if load() isn't?

Does anyone have any thoughts on this?

I suppose another question is, how can you tell if a component if fully
initialised and ready to use?

Thanks.

Adrian

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to