Introduction of my code: I have a Vgroup inside a scroller, because the user is going to add a numbers of objects.
Each time the user clicks the Button, its going to add to the Vgroup and Hgroup that has 3 objects inside (look in agregar_clickhandler). This 3 objects are a textInput, and numeric stepper and a delete icon.
What I want to do is to extract the information in the textinput and numeric stepper inside each Hgroup each time the user edits it.
For example, when I have to delete an Hgroup, i use the Eliminar function, which works well. I try to do something similar to obtain the text in the textInput but nothing is working.
What I am doing is I add an event listener to the TextInput, so when the user types something, I can extract that information.
I appreciate the help.
<s:Button id="agregar" x="36" y="533" label="Agregar mas mensajes " fontSize="20"
click="agregar_clickHandler(event)"/>
<s:Scroller x="36" y="99" width="554" height="400">
<s:VGroup width="100%" height="100%" id="scroller">
</s:VGroup>
</s:Scroller>
protected function agregar_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
var group:HGroup = new HGroup();
group.width = 552;
group.height = 65;
var input:TextInput = new TextInput();
input.width = 360;
input.height = 49;
input.addEventListener(TextOperationEvent.CHANGE, actualizar);
var num:NumericStepper = new NumericStepper();
num.width = 107;
num.height = 49;
num.maximum = 100;
var del:Button = new Button();
del.width = 70;
del.height = 49;
del.label = "delete";
del.setStyle("icon", deleteicon);
del.addEventListener(MouseEvent.CLICK, eliminar);
group.addElement(input);
group.addElement(num);
group.addElement(del);
scroller.addElement(group);
}
protected function eliminar(event:MouseEvent):void
{
scroller.removeElement(HGroup(Button(event.currentTarget).parent));
}
protected function actualizar(event:TextOperationEvent):void
{
var obj:Object = scroller.getElementIndex(HGroup(TextInput(event.currentTarget).parent));
}