Jump to content

On(release)....


divinedesigns1
 Share

Recommended Posts

hey guys first off, sorry if i have not reply to some of my post, i been a little busy. secondly, i just started back using flash and the on(release) doesnt seem to be working, does this function work in flash cs4? because i mask my logo and was going to make the logo into a button, so i used this script on(release){ getURL ("http://www.divinedesigns1.us");} Is this correct?

Link to comment
Share on other sites

Are you using ActionScript 2 or 3? And is the object type "button"?
sup fox, and im using as3 and the logo is a button type
Link to comment
Share on other sites

I don't believe ActionScript 3 allows that syntax. You should switch to ActionScript 2. In ActionScript 3, you'll have to access the object from a script in the main timeline and use addEventListener.

Link to comment
Share on other sites

DDs1, here is some helpful scripting for AS3:

btn_8.addEventListener(MouseEvent.MOUSE_DOWN, nav_8); function nav_8(event:MouseEvent):void {navigateToURL(new URLRequest("REPLACETHISWITHYOURURL"), "_self");trace("should work . . . ");}

You can remove the second statement (trace("this should work ...") ;) After putting this code on it's own layer, you must select the object (your button) and rename the instance name "btn_8" or it will not work. Well that and replacing the text with the URL you would like to navigate to. (REPLACETHISWITHYOURURL) It's much more involved than 2.0 so Ingolme's advice is good and if you're new, you should go with that instead. 3.0 is pretty hard to get used to even if you're really good with 2.0.

Edited by Alluring
Link to comment
Share on other sites

DDs1, here is some helpful scripting for AS3:
btn_8.addEventListener(MouseEvent.MOUSE_DOWN, nav_8); function nav_8(event:MouseEvent):void {navigateToURL(new URLRequest("REPLACETHISWITHYOURURL"), "_self");trace("should work . . . ");}

You can remove the second statement (trace("this should work ...") ;) After putting this code on it's own layer, you must select the object (your button) and rename the instance name "btn_8" or it will not work. Well that and replacing the text with the URL you would like to navigate to. (REPLACETHISWITHYOURURL) It's much more involved than 2.0 so Ingolme's advice is good and if you're new, you should go with that instead. 3.0 is pretty hard to get used to even if you're really good with 2.0.

Alright thanks, i actually figured it was the addeventlistener you had to use thanks tho
Link to comment
Share on other sites

I don't believe ActionScript 3 allows that syntax. You should switch to ActionScript 2. In ActionScript 3, you'll have to access the object from a script in the main timeline and use addEventListener.
thanks foxy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...