Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 22, 2012, 10:48:05 PM

Pages: [1]   Go Down
  Print  
Author Topic: Adding a link to a button in Flash 8/CS3  (Read 4712 times)
Davion
Spaceship Navigator
*****
Offline Offline

Posts: 92


WWW
« 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.
Logged

ReTodd
Lunarpages Senior Designer
Developer
Jabba the Hutt
*****
Offline Offline

Posts: 561



WWW
« Reply #1 on: January 14, 2008, 07:25:40 AM »

That's a tough one, as that code:
 
Code:
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 » Logged

Pages: [1]   Go Up
  Print  
 
Jump to: