ive been wrestling with this for the whole day, if anyone can lend a hand
i have 3 check box’s and input text fields on stage that i would like to null out using the reset button
however i seem to be targeting the objects incorrectly as i am getting this error:
Error #1009: Cannot access a property or method of a null object reference.
package
{
import flash.display.*;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.text.TextField
public class Main extends MovieClip
{
private var aCheckBox:Array;
private var aTextInput:Array;
public function Main():void
{
init();
}
private function init():void
{
bReset.buttonMode = true;
bReset.addEventListener(MouseEvent.CLICK, resetHandler, false, 0, true);
}
private function resetHandler(e:MouseEvent):void
{
aCheckBox = [];
var cb:MovieClip;
for(var i:int=0;i < 3; i++)
{
cb = getChildByName("cb" + (i + 1)) as MovieClip;
aCheckBox.push(cb);
aCheckBox*.selected = false;
}
aTextInput = [];
var ti:MovieClip;
for(var j:int=0;j < 3; j++)
{
ti = getChildByName("ti" + (j + 1)) as MovieClip;
aTextInput.push(ti);
aTextInput[j].text = "";
}
}
}
}