Flash Player 6 (6.0 79.0).
Flash MX 2004.
componentInstance.doLater(target, "function")
target A reference to a Timeline that contains the specified function.
function A string indicating a function name to be called after a frame has passed.
Nothing.
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.
Component properties set in the Property inspector or Component inspector may not be immediately available to ActionScript in the Timeline. For example, attempting to trace the label property from a CheckBox component using ActionScript on the first frame of your SWF fails without notification, even though the component appears on the Stage as expected.
Although properties that are set in a class or a frame script are available immediately, most properties assigned in the Property inspector or Component inspector are not set until the next frame within the component itself.
Although any approach that delays access of the property will resolve this problem, the simplest and most direct solution is to use the doLater() method.
The following example shows how the doLater() method is used:
// doLater() is called from the component instance
myCheckBox.doLater (this, "delay");
// the function or method called from doLater()
function delay() {
trace(myCheckBox.label); // the property can now be traced
// any additional statements go here
}
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00002935.html
Comments
rghome said on Oct 30, 2004 at 3:47 AM :