views:

103

answers:

3

I have a swf embedded into a site, and I want the swf to be clickable so when you click on it it goes to another page. I tried wrapping the whole flash object in tags, and that makes it clickable but the biggest problem I'm having is when you roll over it with the mouse the pointer icon doesn't come up, it just looks like the regular arrow. I tried playing with the css and doing cursor:pointer, but it still doesn't work. Any suggestions? I can edit the .fla file and add some actionscript 2.0 to it, but I'm not sure what to add or where. I'd rather do it through html or css, but if I have to do it in flash that's ok too.

Also, I have an invisible button over the whole thing called, MYbtn

A: 

If you have access to the .fla file, why don't you just edit it so that clicking anywhere on the screen redirects you to a new page? You can create an invisible button or something and use some actionscript to make it move people to a new page. I'm not exactly sure how you do it, but I've definitely made links in SWF files before and it's definitely possible.

hatkirby
+1  A: 

Hi, i think that the best solution is to add some code in your fla. Open it with Flash and locate the timeline. Right-click on the first frame, "Actions" and you can enter your code. You can divide your problem in two point:

  1. Display a link cursor when the mouse is over
  2. Move your browser to your url when the user press the mouse button

For the first problem this code should do the work:

this.buttonMode = true;

For the second problem:

import flash.events.MouseEvent;
import flash.external.ExternalInterface;

this.addEventListener(MouseEvent.CLICK, function(evt:MouseEvent):void{
    ExternalInterface.call("window.location.href = 'http://www.google.com'");
});

I haven't checked with Flash but this should work

wezzy
A: 

The cursor should come up on most browsers , although I still haven't managed to get it to work on Chrome for Mac.

 this.mouseEnabled = true;
 this.buttonMode = true;

 addEventListener(MouseEvent.CLICK , mouseClickHandler );

 function mouseClickHandler(event:MouseEvent):void
{
    navigateToURL( new URLRequest("your location"));
}

Check the docs for more info on navigateToURL http://www.adobe.com/livedocs/flex/2/langref/flash/net/package.html

PatrickS