TypeError: Error #1009: Cannot access a property or method of a null object reference
I've attached an image - might help you visualise my problem.
I currently have all my ActionScript stored within the first frame.
On the fourth frame I have some buttons.
I tried adding the following code on the first frame.
I believe the problem arises because the button I want to create a handler for doesn't exist in frame 1. I know I could solve this issue by having separate ActionScript on the fourth frame. However, I am wanting to pass variables around from frame to frame. So having separate frames of ActionScript isn't what I'm after.
Is it possible to somehow define a button even if it doesn't exist on frame 1?