Groups | Blog | Home
all groups > flash actionscript > february 2006 >

flash actionscript : Error?



WizyWyg
2/24/2006 9:46:53 PM
Im using this on / for one of my buttons:

quitting.onPress = function(){
getURL("javascript:window.close();");
};


The button has an instance of quitting on the stage, but Im getting this error
in the output:

**Error** Scene=playgame, layer=Layer 28, frame=330:Line 1: Statement must
appear within on handler
quitting.onPress = function(){

Total ActionScript Errors: 1 Reported Errors: 1

Why?
ImagicDigital
2/24/2006 10:05:29 PM
Your script is attached to the instance of the button, instead of on a frame.
Make sure you click on a frame in the timeline (you can make a new layer in the
timeline, and name it "Actions" just to be sure), and then paste your code
there. Then make sure that when you click on your button instance on the stage,
nothing shows up in the actions panel.
AddThis Social Bookmark Button