0
votes

I have a .fla file that someone sent and I need to export a flash banner to run on adwords. When I export the file from Adobe Flash Professional CS5 as a .swf file, the .swf becomes click-able. How do I set the URL of that click action?

1

1 Answers

2
votes

As much as I understand you want to navigate to some URL by clicking the banner?

If so, in the document class of your banner or the first frame of the main timeline write the following code:

stage.addEventListener(MouseEvent.CLICK, onStageMouseClick);

and the handler of that click:

function onStageMouseClick(e:MouseEvent):void
{
  navigateToURL(new URLRequest("link here"), "_blank");
}

It doesn't really matter where you write the code, but in your case it makes sense to put in in the beginning of your program so it's available from the start.

You also can specify the target window for your URL, here's a list:

_blank Opens the linked document in a new window or tab

_self Opens the linked document in the same frame as it was clicked

_parent Opens the linked document in the parent frame

_top Opens the linked document in the full body of the window