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)

Related posts:

  1. swfobject – flash doesn't load in Firefox Ran into a bizarre problem today using swfobject. A lot...

Related posts brought to you by Yet Another Related Posts Plugin.

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….

Comment Form

Featured Sponsors


  • Michael: You can use get_header(2) in your case. The filename of your custom header has to be header-2.php. The problem with include(your_file.php) is, all
  • cliff: hi wonder if you can help me, pls i designed www.kouga.mobi using dreamweaver CS3 and now want to make the phonenumbers into links so that if you
  • jerey: how do i rewrite this because it tried RewriteEngine on #Options +FollowSymlinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL

About


Advertisements