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


error:

typeerror: error #1009: cannot access property or method of null object reference.

          at test1_fla::maintimeline/openpage1()[test1_fla.maintimeline::frame2:82]

at test1_fla::maintimeline/onclickbtn1()[test1_fla.maintimeline::frame2:52]

 

 

code:

 

line 77 -83:

function openpage1():void

{

          var pagenum11:int;

          pagenum11 = pagenum1 - 1;

          trace("tween" + pagenum11 + pagenum1);

          mainmenu.tweentext.getchildbyname("tween" + pagenum11 + pagenum1).addtarget(mainmenu.pane1.text1, 1);

}

 

line 46-59:

function onclickbtn1(e:mouseevent):void

{

          switch(e.target)

          {

                    case mainmenu.pane1.btndown:

                              pagenum1 += 1;

                              openpage1();

                              break;

                    case mainmenu.pane1.btnup:

                              openpage1();

                              pagenum1 -= 1;

                              break;

          }

}

 

can tell me did wrong?

if line 82 addtarget line, either

 

  mainmenu.tweentext.getchildbyname("tween" + pagenum11 + pagenum1)

 

or

 

mainmenu.pane1.text1

 

don't exist when code executes.  use trace function determine which.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

uppercase letters in url - Joomla! Forum - community, help and support

Joomla! Update is not offering Joomla 3 - Joomla! Forum - community, help and support