scriptygoddess

02 Dec, 2007

Code to make a button in Flash link to another URL

Posted by: Jennifer In: Flash

This is only just a small snippet of code and probably won't be totally helpful unless you have a fairly good idea what you're doing. I would make a full tutorial, except *I* don't have a complete understanding of what I'm doing. LOL! I know just enough in Flash to be "dangerous".

In any case, from what I can tell, in the latest version of Flash, there is a new way to make a button link to a URL. Instead of creating an action on the same layer as the button, you need to assign an instance name to your button. Then in another layer you have all the code for your buttons – similar to the following:

function gotoYahoo(event:MouseEvent):void
{
var mylink:URLRequest = new URLRequest("http://www.yahoo.com");
navigateToURL(mylink, "_self");
}
buttonInstanceName.addEventListener(MouseEvent.CLICK, gotoYahoo);

(If YOU know more about Flash, and have any corrections – they would be very welcome in the comments. I know how to do simple animations (like slideshows) and simple buttons – but beyond that I'm still in the very early learning stages)

1 Response to "Code to make a button in Flash link to another URL"

1 | vasim

April 8th, 2009 at 6:24 am

Avatar

I am also in learning phase and also know just simple animation. so if any one has action script good tutorial then please inform me…

thnxs….

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements