A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: TypeError #1009

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    40

    TypeError #1009

    I am in the process of moving thousands of lines of code from timeline to external .as files.

    The first error I am getting is:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at joy.infoandflow::MainClass()[C:\Documents and Settings\jspears\My Documents\AS3classes\joy\infoandflow\MainClass.as: 17]

    line 17 is: public var chooseSheet:ComboBox = joyTools.cb2.chooseSheet;

    How do I properly reference a ComboBox (chooseSheet) located within a MovieClip?

    Thanks!

    -Jake

  2. #2
    Member
    Join Date
    Jul 2008
    Posts
    40
    I found that you have to declare your variable in the class and set your variable in the class function:

    PHP Code:
    package
    {
        
    import flash.display.MovieClip;
        
    import fl.controls.ComboBox;
        
        public class 
    Main extends MovieClip
        
    {
            public var 
    chooseSheet:ComboBox;
            
            public function 
    Main()
            {
                
    chooseSheet joyTools.cb2.chooseSheet;
            }
        }


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