homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

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

5+ Year Member

Msg#: 3741957 posted 1:13 pm on Sep 10, 2008 (gmt 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.




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

Msg#: 3741957 posted 7:43 pm on Sep 10, 2008 (gmt 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); }

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved