Microsoft
Software
Hardware
Network
Question : Access to Flex component properties
Hi, being new to Flex, I am trying to understand how to access/change properties of a component instantiated by dragging the component onto the application container from design view.
Reading Adobe help on Flex 3 it states the following
To work with a component in ActionScript, you usually define an id property for that component in the MXML tag. For example, the following code sets the id property of the Button control to the String "myButton".This property is optional if you do not want to access the component with ActionScript.
<mx:Button id="myButton" label="Click Me"/>
This code causes the MXML compiler to autogenerate a public variable named myButton that contains a reference to that Button instance. This autogenerated variable lets you access the component instance in ActionScript. You can explicitly refer to the Button control's instance with its id instance reference in
any ActionScript class
or script block. By referring to a component's instance, you can modify its properties and call its methods.
My question is this. If working with a script block referencing the property to change a value works fine ie mybutton.height=300, but how do I do the same from an actionscript class. The only way I have been able to do it concretely is to access via flexGlobals which I know is not best practice.
Any help on this and best practice with reagard to component method and property calls would be much appreciated.
Regards
Answer : Access to Flex component properties
sorry, my bad
public function test():void{
myClass = new TestClass1();
myClass.classButton = myButton;
myClass.changeText();
}
Random Solutions
From where I can download HP Smartstart version 8.40
Unable to upgrade firmware Netgear GS724TS
Disable "lan settings" button in Internet Explorer
I am trying to run a virtual image off of vmware player and I keep getting an error.
Batch file to modify a text files
SBS Domain Question
Netlogon Service stopped on SBS2003
Moved a Dolpin 7 website to a new server and I get an error message.
web forms: xForms or javascript forms: which one is the best?
Content disappearing after I hit a link?