Skip to main content
May 19, 2015
Answered

Error with buttons

  • May 19, 2015
  • 1 reply
  • 1175 views

I have a game with multiple frames (Menu, Instructions and Game). I have a button in frame 1(menu) to take me to frame 2 and 3, the one for frame 2(game) works like a charm, the one for frame 3 on the other hand, sends me an error. Frame 2 is complete, all the coding is done for it, all I have in frame 3 is a button. I have tested the animation with debug thing, and the error points too the button itself. The button is custom made and imported into the library. However, if I use one of the buttons "premade" in flash, it works fine, it wouldnt be the end of the world if I used their buttons, but mine are prettier, anyone have any idea?

this is the error

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

  at NimGame_fla::MainTimeline/frame1()

  at flash.display::MovieClip/gotoAndStop()

  at NimGame_fla::MainTimeline/toMenu()

This topic has been closed for replies.
Correct answer kglad

This might be asking a lot of you, and would totally understand if you didn't want to do this. If I shared the files with you over dropbox would you be able to look at it and see what you can do? I am very new to this (as you can most likely tell) and still have very limited knowledge to what I am doing. I might be over my head with this frame hopping.


i don't download and correct files unless i'm hired.  free help i offer via the adobe forums and this problem is solvable via the fourms.

it would be faster to pay me to fix the problem but, if you're patient, you should be able to solve this free of charge.

delete your problematic button everywhere in your project.

create a new layer on the main timeline that extends to the last frame of the main timeline.

then drag the problematic button from the library to the new layer's frame 1 of the main timeline and assign the problematic instance name.

test.

1 reply

kglad
Community Expert
May 19, 2015

whatever you think is referencing your button, isn't.  it's not possible to say more because of lack of info.

you could post the line of code triggering the error for more info.  if you button is part of a tween, that can be problematic.

May 19, 2015

I believe this is the line that is causing the error. And no there is no tween. All the button is doing so far is sitting in a fram. I have code in the actions window for it so that it will proceed the animation to specified frames, as seen in code below.

May 20, 2015

assigning that reference correctly depends on how that object is created.

if you used code, show the code.  if you dragged a symbol from your library to the stage or created that object on-stage, while the object is selected assign its name in the properties panel.


I have it as a symbol in my library.

Here is the button is library :

And here are the properties for that button :