I have a form that has several dynamically-created children. I'm having trouble using getChildByName() to retrieve data from them.

Specifically, I create several VBoxes, and in each of those VBoxes I create children (a label and either a textInput, ComboBox or CheckBox). Obviously, the TextInput that I'm trying to get the data from is a child of the VBox, not the 'this', right? So it should be something like 'this.VBox.textInput' right? So I'd getChildByName the VBox first, then use the result of that to getChildByName the TextInput that's the child of the VBox, right?

Well, it's not working. when I try to this.getChildByName() the VBox, I get null instead.

Here's my code, in case I haven't confused you enough. It fails with a 'cant access property of null object' or something like that.

public function resetFormHandler(): void {
        var tempVBox:VBox;
        var tempTextInput:TextInput;
        var tempComboBox:ComboBox;
        var tempCheckBox:CheckBox;
        for (var i:int = 0; i<demoList.length; i++) {
                if (demoList[i].type == "TextInput") {
tempVBox = this.getChildByName("vbox" + demoList[i].name) as VBox; tempTextInput = tempVBox.getChildByName("input" + demoList[i].name) as TextInput;
                        tempTextInput.text = "";
                }
        }
}




Laurence MacNeill
Mableton, Georgia, USA



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------


Reply via email to