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
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With