View Single Post
Old October 29th, 2005, 03:10 PM  
kevin
Legendary Member
 
Join Date: August 7, 2004
Location: NY USA
Default

You have a semi colon after the parameter bracket }

Only use semicolons after statments like functions and such.

Also, MyButton.onpress = function () {... is wrong.

To make a function, you do this:

function MyButton () {
gotoandplay(2);
}

there's no equal sign.

Plus, why are you making a function of it, just have it as below to go to frame 2.

on(release) {
gotoAndPlay(2);
}


But if you're making a function for an unknown reason...

on(release) {
function MyButton () {
gotoAndPlay(2);
}
}

If you're just trying to go to the next frame (2), then you want to use the first whole script I made. The reason is, a function is a peice of script that you can reuse over and over but using MyButton(); and it'll give you output. But it won't when you make it because with "function name() {" you are just creating a function and not executing it. So if name was your function, to use the function later with a different script, you'd just type name()...

Hope you get it. And btw, if you were wondering if gotoAndPlay() was a function, it is. Flash makes it a default one.
kevin is offline   Reply With Quote