tags:

views:

6321

answers:

4

Hello,
I am primarily a developer and dont know to use Adobe Flash CS4. Is there a simple way to add link to flash banner. I have .flv file with some items in Library and two layers.
Please, give me step by step instructions.

Thanks.

Edit: I find simple solution, by steps:

  1. Go to File -> Publish settings and set ActionScript version to ActionScript 2.0
  2. Insert new layer
  3. Create a square with Rectangle tool, that is larger than banner
  4. Right click on square and chose Convert to symbol... In popup windows chose Type: Button
  5. Double click on new button from Library panel and move select from Up to Hit and than go back to main scene
  6. Right click on new blue square and chose Actions and paste this code in soruce editor:

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

  7. Close source editor and export file as movie (File->Export->Export Movie).

+1  A: 

If you have a flash FLA file that shows the FLV movie you can add a button inside the FLA file. This button can be given an action to load the URL.

on (release) {
  getURL("http://someurl/");
}

To make the button transparent you can place a square inside it that is moved to the hit-area frame of the button.

I think it would go too far to explain into depth with pictures how to go about in stackoverflow.

Michiel
I get the error when go to test: 1087: Syntax error: extra characters found after end of program. on (release) {... But I dont see that characters in editor...
sasa
If you go to File > Publish settings... under Flash set your movie to Actionscript 2.0. It should probably work?
Michiel
Yes, it helps me to find solution. Thanks!
sasa
+1  A: 

@Michiel is correct to create a button but the code for ActionScript 3 it is a little different - where movieClipName is the name of your 'button'.

movieClipName.addEventListener(MouseEvent.CLICK, callLink);
function callLink:void {
  var url:String = "http://site";
  var request:URLRequest = new URLRequest(url);
  try {
    navigateToURL(request, '_blank');
  } catch (e:Error) {
    trace("Error occurred!");
  }
}

source: http://scriptplayground.com/tutorials/as/getURL-in-Actionscript-3/

Josh
Adobe Flash CS4 is the authoring environment, this doesn't mean you have to code in Actionscript 2.0/3.0 SWF files. Setting publish settings in CS4 to create Actionscript 1.0 SWF files would also be valid.
Michiel
@Michiel - yes you are perfectly right - i was just giving the as3 version.
Josh
It pains me to say this, but AS2 is better for banners. For some reason the new VM is under a different popup-blocking scheme in browsers. A trivial getURL() in AS2 works great crossbrowser, but the corresponding AS3 code gets blocked in IE and requires some javascript trickery to work. So stick to AS2 if possible.
grapefrukt
A: 

Wow, yours is most reliable information. I've been surfing bunch of webs. Thanks it works great on Flash CS4!!!

Tsolmon
A: 

navigateToURL("http://www.griffinsdesigns.com");

Flash Developer