Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 63
Registered: ‎12-10-2012
My Device: Blackberry 9900
My Carrier: Vodafone-in

Is there any way to update id

Hai currently am working on dynamically created textinputs. On a buttonclick textinputs are created and each one is assigned an id as shown below 

   var tiput:TextInput = new TextInput();			
   tiput.id			=	"TP"+text_ID;
   text_ID	= text_ID + 1;

 each time I click the button a new textinput is being created and id is being set to each one. Also I have another button to delete the particular textinput.  Lets say I created 3 text inputs of with ID "TP1", "TP2", "TP3" if I deleted the second textinput with id 'TP2' then is there any way to change the id of third textinput 'TP3' to TP2.


Any help/advise is appreciated

Thanks in advance

Help is available everywhere but you have to look at the correct place.
By Me :-)
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Is there any way to update id

If you have a reference to it, you should be able to just reset the id of it. Otherwise, you will have to traverse the display list to find the reference to it. Typically, it is best to keep an array of dynamically added items so it is easier to obtain the reference to it.