Select to view content in your preferred language

Actionscript 3 Question

555
1
07-16-2010 08:03 AM
JamesKo
Occasional Contributor
I'm a programming newbie and this forum has been a great resource. I'm hoping someone can answer this simple question.

I've created a form dynamically in actionscript by adding a checkbox to a formitem and then adding the formitem to the form. My question is, how do I access the checkbox programatically?

Thanks in advance.
Tags (2)
0 Kudos
1 Reply
Drew
by
Frequent Contributor
You could probably just get a child by name..

Be sure to set the name property when creating your controls dynamically so you can later refer to them.. then try a method like below to get your checkbox.

private function getCheckBoxByName(name:String):CheckBox
{
       var chk:CheckBox = myForm.getChildByName(name) as CheckBox;
       return chk;
}


Where myForm is the id of your form.

Drew
0 Kudos