You forgot new ArrayCollection somewhere.
Patrick
jmfillman a écrit :
>
> When I click on the Submit button, I get the following error:
>
> "TypeError: Error #1009: Cannot acces a property or method of a null
> object reference.
> at main/validateForm( )
> at main/__btnFormSign_ click()"
>
> What am I doing wrong?
>
> <mx: State name="Forms" >
> <mx:AddChild position="lastChild ">
> <mx:Canvas width="200" height="31" right="10" top="39">
> <mx:Button label="Submit" id="btnFormSign" click="validateForm ();">
> <mx:Script>
> <![CDATA[
> [Bindable]
> public var validationAC: ArrayCollection;
>
> public function validateForm( ) :void {
>
> if (text1.text. length < 3) {
> validationAC. addItem({ label:"Text1" , data:false}) ;
> }
> }
> </mx:Script>
> </mx:Button>
> </mx:Canvas>
>
>