homepage Welcome to WebmasterWorld Guest from 23.20.33.176
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
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?
jsprajapati




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

Hi,

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

ie.
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.

Thanks.

 

rocknbil




msg:3742244
 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'); }
};
</script>
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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved