A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Error #1009: Cannot access a property or method of a null object reference

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Error #1009: Cannot access a property or method of a null object reference

    Situation is this: i have a main .mxml file from which i imported custom component which is basically Accordion with two elements and inside them is TextArea control for each one. I have a function in main .mxml which displays that component as a popUp (using popUp manager class) and populates those two TextArea controls with some text. I can populate first one TextArea just fine but when i try to populate second one the same way i did the first one i get this error:

    Code:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at SMC/popUp2()
        at SMC/writeToOutput()
        at SMC/___SMC_Button1_click()
    I don't really understand this error and i am not sure what i've done wrong, can someone please help me?

    thank you

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Update

    Here is code from my OutputPopUp.mxml component:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" width="950" height="650" backgroundColor="#444242" showCloseButton="true" creationComplete="popUpCenter();" title="Output" horizontalAlign="center" verticalAlign="middle">
    	
    	<mx:Script>
        <![CDATA[
    
        import mx.managers.PopUpManager;
    
        public function popUpCenter():void {
        PopUpManager.centerPopUp(this);
        }
    
        ]]>
        </mx:Script>
    	
    	
    	 <mx:Accordion id="accordion" width="100%" height="100%">
                
                <mx:VBox label=".smil output" id="SmilVBOX" width="920" height="557">
                    <mx:TextArea id="Text1" wordWrap="true" editable="false" width="920" height="557" backgroundColor="#4A4A4A" color="#FFFFFF"/>
                </mx:VBox>
    
                <mx:VBox label=".rt output" id="rtVBOX" width="920" height="559">
                	<mx:TextArea id="Text2" width="920" height="558" backgroundColor="#4A4A4A" text="Test text" color="#FFFFFF" wordWrap="true" editable="false"/>
                </mx:VBox>
                
         </mx:Accordion>
    	
    	
    </mx:TitleWindow>
    And from my main .mxml file i display that component using popUpManager class and try to load string to both TextAreas:
    Code:
    var outputPopUp:OutputPopUp = OutputPopUp (PopUpManager.createPopUp(this, OutputPopUp, true));
            	
    outputPopUp.SmilVBOX.label = odabraniFile2;
    outputPopUp.rtVBOX.label = RTfullPath;
    
    outputPopUp.Text1.text = "Text1";	
    outputPopUp.Text2.text = "Text2";     //this is where i get this error
    but it only works for first one and for second one TextArea displays above error so i am not sure what's going on here?

  3. #3
    Junior Member
    Join Date
    Sep 2008
    Posts
    1
    Did you ever resolve the accordion/textarea issue? I have the same problem. Please let me know if you found a solution.

    Thanks!!

    Tony

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center