TypeError: Error #1009: Cannot access a property or method of a null object reference. at Hospitalroom_fla::MainTimeline/frame1()
i need to assign AS code to a button (“my_btn”). that button is inside 3 other mc’s:
here is it path-
root.mc1.mc2.mc3.my_btn.
i understand i get this error because my_btn is not initialize when i press ctrl+ENTER.
how can i make it initialize anyway?
please please help… i tried everything…
**what can i do? that button must be in that path…
**
the FLA is Attached
and the AS code is:
stop();
buttonMode=true;
mc1.mc2.mc3.my_btn.addEventListener(MouseEvent.CLICK, traceclicked);
function traceclicked(evt:MouseEvent):void {
trace(“my_btn has clicked”);
}
**please please try to help me, i have no idea what shell i do…
**
thank you very much!