make link on SWF File to another HTML

38,679

Solution 1

You can use SWFObject to add a flashvar like this:

<script type="text/javascript">
    var flashvars = {};
    flashvars.targetURL = "http://www.stackoverflow.com";
    var params = {};
    var attributes = {};
    swfobject.embedSWF("myflashmovie.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes);
</script>

That being said, this is assuming that within your Flash movie, it is coded such that the Flash movie is expecting that flashvar and using that link to the stipulated URL

In AS 2.0 it would be:

getURL(_root.targetURL);


In AS 3.0 it would be:

var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
var linkURL = flashvars['targetURL']; 
var link:URLRequest = new URLRequest (linkURL);
navigateToURL(link);

Solution 2

I think I fixed it. Here is what I did:

  1. made a clear png graphic the same size as the area you want your flash video to be in

  2. make a new layer (div tag) over the flash video - you must be in standard view to edit layers - layers are like tables: they hold images,text, etc.(beware: if you are using tables, the div tag will float over the table when you resize your browser)

  3. add the blank png into the new layer

  4. link the blank png using the properties window in dreamweaver!

  5. Within your object tag that holds the flash object add this line of code . This sets the background of your flash movie to transparent and allows the png layer to be placed above it. If you still need your flash movie to have a background, just create a colored box in your flash movie and use it as a background.

Share:
38,679

Related videos on Youtube

Diego Fosso
Author by

Diego Fosso

Updated on July 05, 2022

Comments

  • Diego Fosso
    Diego Fosso almost 2 years

    I am having a problem with SWF File. I have a SWF File on my HTML page and i need to link it to another HTML i used but the anchor is not working. Any one can help me. How to link a SWF file. Thanks

  • Trufa
    Trufa almost 13 years
    Please format your code appropriately, click on the orange question-mark in the question or answer text box for help. Thanks!

Related