all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

Help on error message


Help on error message kwillmo
6/5/2005 10:32:46 PM
flash actionscript:
When I try to link a button, this is the error message I get:

**Error** Scene=Scene 1, layer=Layer 5, frame=33:Line 1: ')' or ',' expected
getURL(http://www.yahoo.com);

Total ActionScript Errors: 1 Reported Errors: 1

Any suggestions on what I'm doing wrong here? Thanks-Kevin
Re: Help on error message NSurveyor
6/5/2005 10:38:43 PM
You need to put quotes around the url because it is a string. Try this:

Re: Help on error message NSurveyor
6/5/2005 10:40:45 PM
BTW, the error message happens because you have //. In ActionScript, // denotes
that the code following is just a comment and is not actual code. So, with your
code, this is what is tried to be run:

getURL(http:

Obviously, this makes no sense. And the error states a missing ) which would
be missing if in this case.
Re: Help on error message kwillmo
6/5/2005 10:47:29 PM
Thanks very much, now I get a different error.

**Error** Symbol=Button, layer=Text, frame=1:Line 1: Statement must appear
within on handler
getURL("http://www.yahoo.com");

Total ActionScript Errors: 1 Reported Errors: 1

Any other ideas?
Re: Help on error message NSurveyor
6/5/2005 10:51:47 PM
When do you want this code to be run? When the timeline hits a certain frame,
when you click a button, etc. Apparently you are trying to put the code on a
button or movieclip. When you put code on a button or on a movieclip it needs
to be in some sort of event handler. Basically, it needs to know at which event
(like rollOver, press, release, etc) to envoke the script. If you wanted the
getURL to happen when you release a button, you would use:

on(release){
getURL("http://www.yahoo.com");
}
Re: Help on error message kwillmo
6/5/2005 11:06:16 PM
Well no more error messages, thanks. I must be doing something wrong, the
button still does not link. The button changes on mouseover the way it looks,
but I cannot figure out how to get the button (or the other 5 in the same flash
file) to actually link to another webpage. Does each link need its own button?


http://www.kevinwillmot.com/header2.html

Here is what the file looks like.
AddThis Social Bookmark Button