I've been searching for a solution to my problem for hours now but I can't find one. My problem is that I have some buttons inside a MovieClip and I want to control them from the Main timeline. But here's the weird part. The button I have in the first frame in the MovieClip works just fine, but the other two buttons, which is in frame 2 and 3, wont work when I click on them and I get this error message because of the buttons:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at Eksamen_fla::MainTimeline/frame1()
Thank you!
mc.btn1.addEventListener(MouseEvent.CLICK, btn1Action); function btn1Action (evt:MouseEvent) { regUt.push(mc.txt1.text); point.push(int(mc.txt2.text) + int(mc.txt3.text) + int(mc.txt3.text)); mc.nextFrame(); } mc.btn2.addEventListener(MouseEvent.CLICK, btn2Action); function btn2Action(evt:MouseEvent) { mc.prevFrame(); }
The code is outside the MovieClip and in the Main timeline in frame 1. Maybe that's the problem? – user2201775