views:

9940

answers:

8

Hi, 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

A: 

Perhaps you can post a little more info on what you are trying to do. Any actionscript?

Typeoneerror
A: 

I have a Flash Movie on my HTML page. When i click on this movie i want to link this to another HTMl File so onClick it move to my next HTML page same like we make links with . I have tried like this but its not working is there any other way to link a Flash file. Please refer any sample thanks.

Talha Bin Shakir
A: 

Here is a link to a blog post about how to navigate to a url through flash:

Linking to url in action script 3

Jason Miesionczek
A: 

I need a example of Java Script i don't want to embed the URL code in my flash file. I am using the SWFOBJECT.js File to embed my Flash movie. So is there any parameter or variable with that i can pass my URL so when i click anywhere on my SWF Object it will take me to that page such as "http://www.index.php".

Talha Bin Shakir
Hi Talha, you should try to edit your post to give a better description rather than just adding more replies to the thread. That is the typical way of how to ask questions here is Stack Overflow.
Ronnie Liew
A: 

you need actionscript to link your swf. i thinks its getUrl() command

+4  A: 

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);
Ronnie Liew
A: 

you can also add javascript command but onclick does not work because it is already preset. by using onmouseover command will do the trick but do you want to do it that way? if so

`<object type="application/x-shockwave-flash" onMouseOver="parent.location='http://www.mysite.com'"&gt; <param name="wmode" value="transparent" /><param name="movie" value="101.swf" /></object>
chico
A: 

Ey check this out it worked

Lovemore