I converted a graphic into a symbol, then I made it a button. I then added an
action (a "getURL" action) and typed in this info, getURL(info.html);
**Error** Scene=Scene 1, layer=Banner Image, frame=1:Line 1: Statement must
appear within on handler
getURL(info.html);
Total ActionScript Errors: 1 Reported Errors: 1
but I get an error when I test it in Flash. What is the correct way to turn an
image into a link so it is a button when it is an .SWF? I hope this makes some
sense?
Thanks
Noelbaland - 06 Jul 2008 03:49 GMT
Hello there,
It looks like you didn't put your action between an on(release) statement.
If you attach script to a button it should be within an release or press
statement, like so
on(release)
{
getURL("info.html");
}
If you want to attach script for a button on a frame in it's timeline, then
you need to give your button a name in the Properties panel and refer to it
from your script like this.
myButtonName.onRelease = function()
{
getURL("info.html");
}
Also the first parameter for the getURL function is a string and must be
enclosed in quotes "".
Hope that helps