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
ASP.NET Search script
In Latex, how do I change the format of automatic equation numbering?
Benefits of upgrading from exchange 2003 to Exchange 2010
Rules at the mailbox level via Exchange
Put control inside of AJAX UpdatePanel, now get Type 'System.Web.UI.UpdatePanel
' does not have a public property named 'FileUpload'
Exchange restore using ntbackup
VBS - Help needed to modify the code
Document Review
Bash Script
Find and Replace Hyperlinks in Access 2007