2 Replies Latest reply on Jun 5, 2010 3:48 AM by Maxijin2

    Flex 4 : Template Component : STATES : Null Problem

    Maxijin2 Level 1


      I have created a template component based on following link



      My component uses STATES, and and my code assign a runtime new component in second state. When i run code, i get "Cannot access a property or method of a null object reference." Error.


      Please Help



      Main File Code


      Template component Code

      <?xml version="1.0" encoding="utf-8"?>
      <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 verticalAlign="middle" horizontalAlign="center"
                 width="400" height="300" initialize="vgroup1_initializeHandler(event)"> 
                <s:State name="State1"/>
                <s:State name="SECOND"/>
                     import mx.core.UIComponent;
                     import mx.events.FlexEvent;               
                     public var Edit:UIComponent;
                     protected function vgroup1_initializeHandler(event:FlexEvent):void
           <s:Label text="First View" includeIn="State1"/>
           <s:VGroup id="BaseArea" includeIn="SECOND" width="200" height="200"/>