Lunarpages Web Hosting Forum

Author Topic: Adding a link to a button in Flash 8/CS3  (Read 7233 times)

Offline Davion

  • Spaceship Navigator
  • *****
  • Posts: 92
    • http://www.atlasfishcompany.com
Adding a link to a button in Flash 8/CS3
« on: January 14, 2008, 02:58:47 AM »
This is now driving me up the wall, I've been trying to add a link to a button in both Flash 8 and CS3 and when I preview the movie the cursor changes to a pointing hand but when you click nothing happens.

Here is the actionscript code applied to the symbol:

on (release) {
   getURL("http://www.google.com", "_blank");
}

I've copied and pasted that code into the actions panel with the button symbol selected.  I have also tried naming the button and applying the code to the layer to run on the button ie:

my_button.addEventListener(MouseEvent.CLICK,clickHandler);
function clickHandler(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.adobe.com"),"_self");
}

I have tried running the button in both action script 2 and 3, and help in regards to this would be greatly appretiated, thanx.

todd_1

  • Guest
Re: Adding a link to a button in Flash 8/CS3
« Reply #1 on: January 14, 2008, 07:25:40 AM »
That's a tough one, as that code:
 
Code: [Select]
on (release) {
   getURL("http://www.google.com", "_blank");
}

should work as long as its tied to the button instance. Have you tried on (press) {}  as well?

I have found a couple of things on the web regarding a bug in firefox, and one in IE:

http://probertson.com/articles/2006/10/11/geturl-flash-projector-firefox-problem/
http://blog.madebyderek.com/archives/2007/09/11/fscommand-and-geturl-bug-in-flash-player-9/

as well as someone said this
Quote
when a swf is inserted into an html file and run locally getURL will NOT work on some machines using flash player 8, although the same file will run correctly when run from a server.

Check out this page for some workarounds:
http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in-Flash-Player-9

Hope this helps.
« Last Edit: January 14, 2008, 07:28:03 AM by ReTodd »