I’m am super new at this, and this is my first time ever using Adobe. I get the “joy” of doing a project in my school using The CS4 Suite. I was playing around and using this book to help me get a button to start an action. I have tried many different codings, but this one gets me the least amount of errors. This is what I have so far:
var isPlaying = false;
this.myButton.addEventListener(MouseEvent.MOUSE_DOWN, onButtonClicked);
this.myButton.onButtonClicked = function(){
gotoAndPlay(5);
}
Line 3, Error 1119: Access of undefined property onButtonClicked.
Line 5, Error 1120: Access of possibly undefined property onButtonClicked through a reference with static type
…What am I doing wrong?
The function called by the event should not be set like that. The code that you have is more like Javascript than ActionScript.
Also, try to read documentation, more info on: