Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Set url on swf file

How to set url on external swf file in html page?

1:13 pm on Sep 10, 2008 (gmt 0)

New User

5+ Year Member

joined:Sept 10, 2008
votes: 0


Anybody can help, how to set url on external swf file in html?

i have test.swf file, that is embeded in html page. i want to set url on this swf file like..

<a href="link.html"><embed....></embed></a>

Please reply asap.


7:43 pm on Sept 10, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Welcome aboard jsprajapati! You would do this in the movie. Create a transparent movie clip the full width of the movie, positioned exactly at 0,0. Set the clip on the stage, name the instance (example, myUrlButton). in the first frame,

myUrlButton.onRelease = function() { getURL(....); }

If you want this accessible by the page itself, you will have to use a query string or flashVars to pass the URL to the Flash object. I haven't done this for a while because I use SWFObject for Flash, which does the same thing in a different way:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var myVideo = new SWFObject('my-video.swf', 'vid', '330', '290', '6', '#ffffff');
myVideo.addParam("wmode", "transparent");
myVideo.addVariable("url", "enter-your-url-here");
window.onload = function() {
if (document.getElementById('my-video-div')) {
myVideo.write('my-video-div'); }
In the above example, your flash would have a variable "url," so you'd be able to use the first example to do this:

myUrlButton.onRelease = function() { getURL(url); }


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members