Web Hosting Forum | Lunarpages
News: April 3, 2008 - New Contest! - Win 5 Years of Hosting and $1,000!
May 5, 2008 - May 08 Web Site of the Month? - Submit your LINKS!!!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 16, 2008, 01:29:03 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Adding a link to a button in Flash 8/CS3  (Read 1231 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: 553



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM