views:

189

answers:

2

Hi

I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs.

To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at http://i34.tinypic.com/2gugio6.jpg

Any help/pointers are appreciated.

Thanks

+1  A: 

It would help if you post some code. Since I don't know the details, I am giving you the most basic answer.

For example, if you want id of a button in your code, you specify that id in the mxml. So,

<mx:Button label="myButton" id="btn1"/>

Now, say in your script you want to add an event listener here, you access this as

btn1.addEventListener ....

Now, lets say you want to access not a button or some independent control, but you want to access elements inside a list, there are several ways. I am presuming you would like to access the selected item. You simply say

list1.selectedItem

As I said, it would help if you post your code and specify a more precise problem.

Tanmay
A: 

I am unable to get the id of the child control on which the click event occurs.

Use event.currentTarget inside the event handler to access the child control in which the event occurred.

Amarghosh