Statment must appear within on handler error[F8]
Hey all, I'm getting the error "statement must appear within on handler error" with the following code:
Code:
var newgrounds:String = "http://www.newgrounds.com/audio/";
on (release)
{
getURL(newgrounds, "_blank");
anybody know the problem? Thanks for help!
Error Message : I need Help! :)
Hey Everyone, I cannot figure out what is causing this error message, I thought it was due to the fact that I had not got my "loading random background" to work, but I fixed it and I am still recieving the following message:
Scene=Scene 1, layer=randomjpeg, frame=51, Line 1 Statement must appear within on/onClipEvent Handler
Scene=Scene 1, layer=randomjpeg, frame=51, Line 2 Statement must appear within on/onClipEvent Handler
I know it is directing me to the exact line and frame, but I don't know what to do about it
this is the code I have attached to that frame: I am working in CS5 with AS2.0
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;
case 3 :
location.loadMovie("image3.swf");
break;
case 4 :
location.loadMovie("image4.swf");
break;
case 5 :
location.loadMovie("image5.swf");
break;
}
Any help would be much appreciated!