Don’t call commitProperties
yourself, it will be called for you at an appropriate time. You can’t do
things right at construction when you’re dealing with UIObjects, waitfor
the system to do its thing first.
Matt
From: ckovey
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 09, 2005
8:15 PM
To: [email protected]
Subject: [flexcoders] Re:
Accessing tag attributes at construction
Thanks for the speedy reply Matt
Perhaps I'm not quite grasping something, I still
got undefined values
after doing commitProperties. I must be
doing something stupid...
Here is the modified Widget:
class Widget extends mx.containers.HBox {
import
mx.controls.*;
public var
attrib:String;
public function
Widget() {
//Alert.show("this.attrib="+this.attrib + "\r" +
"attrib="+attrib,"Constructor");
commitProperties();
}
function
commitProperties() : Void {
super.commitProperties();
Alert.show("this.attrib="+this.attrib
+ "\r" +
"attrib="+attrib,"Commit
Properties");
}
public function initWidget():Void
{
Alert.show("this.attrib="+this.attrib
+ "\r" +
"attrib="+attrib,"Initialize");
}
}
I appreciate your help!
--- In [email protected],
Matt Chotin <[EMAIL PROTECTED]>
wrote:
> In Widget instead of doing anything in the
constructor you can do
it in
> commitProperties()
>
>
>
> function commitProperties() : Void
>
> {
>
> super.commitProperties();
>
> //your code here
>
> }
>
>
>
> Matt
|