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

flash actionscript

group:

on click action for a botton



on click action for a botton amit_s
9/20/2005 8:08:01 PM
flash actionscript: Hi all, can someone please rewrite this script for me so it actually lunches
the url mentioned. I am having problems doing this. Here is the script;
onRelease getURL("http://www.anshen.com/US/dialogue/dia.ann.html" , "_self");

right now it says there is a syntex error: ( Line 1: Syntax error.
{onRelease getURL("http://www.anshen.com/US/dialogue/dia.ann.html" ,
"_self"); }; )

thanks
Re: on click action for a botton. please help!!! Brandine
9/20/2005 8:39:36 PM
on (release){

getURL("http://www.anshen.com/US/dialogue/dia.ann.html" , "_self");

}

----
Re: on click action for a botton. please help!!! amit_s
9/20/2005 8:48:28 PM
thanks for comming tor my aid,

now that I pasted what you wrote it gives me the follwoing error message:

**Error** Scene=Scene 1, layer=Layer 17, frame=579:Line 1: Mouse events are
permitted only for button instances
on (release){

what do you thing this is about? shoud I name the frame lable or something
like that
Re: on click action for a botton. please help!!! Brandine
9/20/2005 8:53:39 PM
hey amit,

you need to paste the code I posted on the actual button that you click on to
call the url. This is the Flash 5 Method of using a button action. You have
pasted the code I posted on a frame. If you want your code to reside on a
frame, you can do it this way, which is Flash MX and up preferred method:

myButton.onRelease = function(){

getURL("http://www.anshen.com/US/dialogue/dia.ann.html" , "_self");

}

You will have to name your button "myButton" in order for this code to work,
or name your button something different and change "myButton" in the code I
posted to your preferred instance name.

Hope this helps,
Brandine

----
milkin' cows is only fun when it's cold outside



AddThis Social Bookmark Button