Monday, June 25, 2012

[Action Script] TypeError 1009 won't go away June,2012

I know that this is a common error that has been addressed but I've read all the threads and Adobe's library explanation of the error--
but I still cannot figure out what's wrong with my code (it worked earlier).
EDIT: So I think my debugger is saying my problem starts in the addEventListener line:
Code: //this is the document class (MainCharacter.as), inside the Main Character class
                public function MainCharacter()
                {
                        init();
                }
                public function init():void
                {
                        stage.addEventListener(KeyboardEvent.KEY_DOWN,ifKeyD);
                        stage.addEventListener(KeyboardEvent.KEY_UP,ifKeyU);
                        addEventListener(Event.ENTER_FRAME,ifEnterFrame);
                }Output message:
Code: TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at MainCharacter/init()
        at MainCharacter()
TypeError 1009 won't go away

Related Post



0 comments: