Skip to main content
February 3, 2009
Answered

Bug in CS4 or I am doing something wrong

  • February 3, 2009
  • 2 replies
  • 534 views
I have Adobe Flash CS4, and I have made an fla that has two, one frame long scenes in it:
Scene 1
Scene 2

there is a button on each, there instance names are:
button
button2

It says there are no errors in the code, but when I preview or publish it, I get this error in the output window:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at SceneNavigation_fla::MainTimeline/__setProp_button2_Scene2_Layer1_0()
at SceneNavigation_fla::MainTimeline/frame1()

What is weird is I went to this site:
http://flashthusiast.com/2008/07/31/creating-buttons-that-link-to-different-scenes-using-actionscript-30/
and downloaded the sample file that came with the tutorial, and that came up with the same error.

If you want to see the .fla that I made, download it here:

http://www.easy-share.com/1903492975/Scene_Navigation.fla
This topic has been closed for replies.
Correct answer clbeech
you need to give each button the proper 'instance name' (not the buttons text or label) in the above code the scene one button's instance name is 'button' - in two it is 'button2'

select your button on the stage, look in the properties panel, on the left enter the 'instance name' of the buttons respectively.

2 replies

clbeech
clbeechCorrect answer
Inspiring
February 3, 2009
you need to give each button the proper 'instance name' (not the buttons text or label) in the above code the scene one button's instance name is 'button' - in two it is 'button2'

select your button on the stage, look in the properties panel, on the left enter the 'instance name' of the buttons respectively.
February 3, 2009
Yeh I have already done that. The whole button has the instance name "button", have you downloaded the fla to see
for your self?

February 3, 2009
update:

If i rename both of the buttons text to "Label" then the error goes.

wtf?