Groups | Blog | Home
all groups > flash actionscript > february 2006 >

flash actionscript : getURL Actionscript not working


Brian Battles
2/22/2006 11:47:07 PM
I set this Actionscript for a button in my Flash movie. I tested it on my
website and I get no action from clicking on the button.

on (release) {
getURL("http://www.mywebsite.com/cd/richard", "_blank");
}
blemmo
2/23/2006 12:00:41 AM
The code is ok, maybe your movie stops at another frame (where the button doesn't have this code)?
Brian Battles
2/23/2006 12:21:53 AM
blemmo, you were correct. I had the button in two different keyframes. I kept checking one, not realizing the other did not have and Actionscript applied.

blemmo
2/23/2006 12:37:44 AM
You're welcome.

That's a reason why I prefer timeline functions over the on(someEvent)
handlers: You would set the method once and it will affect the Button/MC as
long as it has the right instance name. For example: if you have this code in
the first frame where the Button appears:
theButton.onRelease = function() {
trace("hi");
}
it will work in every frame from that where the Button's instance name is
'theButton'. It also makes it possible to change the actions dynamically or
delete them (delete theButton.onRelease). I think it's way more handy than the
on(xxx) handlers.

cheers,
blemmo
AddThis Social Bookmark Button