Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make link on SWF File to another HTML

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

like image 428
Talha Bin Shakir Avatar asked Dec 22 '22 13:12

Talha Bin Shakir


1 Answers

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);
like image 70
Ronnie Liew Avatar answered Dec 26 '22 17:12

Ronnie Liew