hi,i am new to flash.... i have made a simple flash banner which has 8 layers...now i wanna link it to a webpage...how????

Dani AI

Generated

Short update and context: OP wanted a banner that opens a webpage. , and showed the classic .swf + ActionScript approach (getURL / onRelease). Important: Flash Player reached end‑of‑life on December 31, 2020 and modern browsers have removed or blocked the plugin, so an SWF banner is not a reliable way to send web visitors to a URL today — plan for an HTML5 alternative or an emulator if the audience still needs SWF playback. () ()

For environments that still run SWF (legacy intranets, local projectors, ad servers that accept SWF), ActionScript 3 uses navigateToURL plus a URLRequest; ad networks expect an external click variable (clickTAG/clickTag) instead of hardcoded URLs. Example AS3 pattern (reads clickTAG, falls back to a static URL):

import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;

myButton.addEventListener(MouseEvent.CLICK, onClick);

function onClick(e:MouseEvent):void {
    var targetURL:String = root.loaderInfo.parameters.clickTAG || "https://example.com";
    try {
        navigateToURL(new URLRequest(targetURL), "_blank");
    } catch (err:Error) {
        trace("navigateToURL failed: " + err.message);
    }
}

Industry ad guidance and the clickTAG pattern are documented in Adobe/advertising resources. (adobe.com)

Troubleshooting when the SWF link works standalone but not after publishing to HTML (issue raised by ): common causes are the embed parameters or page layout. Check these in a minimal test page first — do not repeat the site's other scripts/CSS:

  • wmode: windowless modes (transparent/opaque) change stacking and input behavior; try wmode="window" to restore normal clicks.
  • allowScriptAccess / flashvars: ensure allowScriptAccess is correct for cross‑domain or JS calls.
  • overlays/z‑index: an invisible DIV or positioned element can sit over the object/embed and block clicks.
  • https vs http: mixed‑content or wrong protocol may break navigate calls.

See the Animate/Flash publish parameter docs for details on wmode and allowScriptAccess. ()

Recommended long‑term options: export the creative to HTML5 Canvas via Adobe Animate or rebuild the banner in HTML/CSS/JS (better browser compatibility and accessible links). For archival or running legacy SWFs in the browser, the open‑source emulator Ruffle can help but has limitations (AS3 support is still evolving). () (Ruffle on GitHub). ()

Recommended Answers

All 13 Replies

You need to save it as a .swf file. Then you need to embed it in the webpage using the HTML code Flash can generate for you.

You need to save it as a .swf file. Then you need to embed it in the webpage using the HTML code Flash can generate for you.

yeah i hav done that and now when i click on that .swf file it shud take me to new webpage say yahoo.com in a new window...
thanks for the reply

Oh, you want to make the flash file load a webpage when you click on it. That's a different story. Sorry but I don't know enough about Flash to help you with that.

Member Avatar for Member #114696

If you haven't added any action to any symbol, i.e. you flash movie is just a movie nothing dynamic, then this is the simples way.

1. Add a new layer, say "actions"
2. Make sure that the last frame(note: its frame not keyframe) number is equal to the last frame of whole movie. This is to ensure that the following code works throughout the movie
3. Now click on the first frame of actions layer and press F9 to open Action Panel and write this code:

_root.onMouseUp= function() {
    getURL("http://www.google.com", "_blank");
};

That's it

hey, if you want to link a piece of flash to a web site simply in the .fla . Insert a new layer , name this layer a (for actionscript/actions) . Inside type the following, say the thing you wanted someone to click on was a button which you named ,as a movie clip * mcbutton *
:

mcbutton.onRelease = function:void () {
getURL("http://www.yahoo.com");
};

and that will link you to yahoo!

That's exactly what the post above yours said.

yeh, but i tried to explain it without the root tags and gave examples so they could understand

Thanks to vishesh my flash banner is linked too!

thanks vishesh my flash also target to my website sucessfully
thanks so much for shair this information

The internet is a very helpful tool nowadays! Especially with forums, and people that join tend to know something another user didn't! Lets keep the help coming!

You must design a lightweight Flash banner for faster loading. Some of your target audience may use low speed internet connection and if the banner ad is too heavy, they will skip it. For instance, you may think that audio effects can be helpful to capture your target audience's attention, but make sure that it does not increase the file size too much.

Make sure the symbol you want to make 'clickable' is a button. Select you're button and open up the action script and paste in the following:

on (release) {
//Goto Webpage Behavior
getURL("http://www.WEBSITEHERE.com","_…
//End Behavior
}
******

An other way to do this is go to. Window > Behaviors > Web

Hi there, I am able to link the hyperlink to the swf and it works fine. but when I publish it to html the hyperlink does not work. Is there any simple way to just insert hyperlink like in word or html softwares?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.