Yes, as long as the components are in scope and you have instantiated
them using mxml tags, you can get a reference to them using the id
property.

 

So you can say:

button1.height = button1.height + 10;

 

or whatever property you want to set.

 

If you have instantiated them using AS addChild, it is a bit more
difficult.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of suman.karumuri
Sent: Thursday, October 25, 2007 5:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] getElementByID equivalent

 

Hi all,

I am a flex noob. I am writing an application in which I have to 
change the height and width of the buttons and other elements in a 
VBox based on some user action.

To do this, I have assigned id's like "button1", "button2" .. to the 
buttons, I want to modify when the user clicks on a button. I want 
to know if there is a method like getElementById(as in JS) in flex 
using which I can get the object reference given an ID. That way I 
hope to manipulate the buttons and many other elements on the screen 
easily. Any pointers are appreciated?

Or is there a better way to do it?

Thanks in advance,
-S-

 

Reply via email to