Advertisement
I'm building my first flash file and I simply want to make a button that takes the user from Scene 1 to Scene 2. I followed the help instructions and got the script that is suppose to make it work.
This is what I entered into the action panel:
//This script takes the user to Scene 2 when goScene_btn is released
this.EnterExhibit_btn.onRelease = function (){
gotoAndStop("Scene 2", 1);
};
I use the check script function in the action panel and got a "script has no errors" confirmation.
However when I run the test movie I get this in the output panel:
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 4: Statement must appear within on handler
EnterExhibit_btn.onRelease = function (){
Total ActionScript Errors: 1 Reported Errors: 1
Questions:
1.What am I doing wrong?
2.What does "Statement must appear within on handler" mean?
The button shows up as a button in the property inspector. It was created by the "Convert to Symbol" function and was never any other kind of symbol other than a button.
This is what I entered into the action panel:
//This script takes the user to Scene 2 when goScene_btn is released
this.EnterExhibit_btn.onRelease = function (){
gotoAndStop("Scene 2", 1);
};
I use the check script function in the action panel and got a "script has no errors" confirmation.
However when I run the test movie I get this in the output panel:
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 4: Statement must appear within on handler
EnterExhibit_btn.onRelease = function (){
Total ActionScript Errors: 1 Reported Errors: 1
Questions:
1.What am I doing wrong?
2.What does "Statement must appear within on handler" mean?
The button shows up as a button in the property inspector. It was created by the "Convert to Symbol" function and was never any other kind of symbol other than a button.
Advertisement
Advertisement