Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
How to wrap a SWF file in anchor tags??
Old 10-28-2010, 03:20 AM How to wrap a SWF file in anchor tags??
TWD
TWD's Avatar
King Spam Talker

Posts: 1,184
Trades: 0
I've tried wrapping the object like this:

Code:
<a href="http://www.mysite.com"><object type="application/x-shockwave-flash"
 width="960" height="157"
 data="http://www.mysite.com/flash/myflash.swf">
<param name="movie"
 value="http://www.mysite.com/flash/myflash.swf"></param>
<param name="wmode" value="transparent"></param>
<img src="http://www.mysite.com/images/mystaticimage.jpg"
 width="960" height="157" alt="" title=""/>
</object>
</a>
Strangely it seems to work in Firefox but not any other browser.

Yes, I know it's possible to natively embed a hyperlink in flash.
But in this case its not what I want to do.
The link has to be applied programmatically because it will contain a different query string each time.

Any ideas?
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-28-2010, 09:19 AM Re: How to wrap a SWF file in anchor tags??
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Well for one thing, that's not valid. Have you tried wrapping it in a span?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-28-2010, 11:30 AM Re: How to wrap a SWF file in anchor tags??
TWD
TWD's Avatar
King Spam Talker

Posts: 1,184
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Well for one thing, that's not valid. Have you tried wrapping it in a span?
I didnt realize that <param> was a self enclosing tag in XHTML so thanks for the heads up on that one. It doesnt really have any bearing on the problem though.

I tried nesting the <object> inside a <span> and then nesting THAT inside the anchor tags but still no dice. Same thing with using <div> tags.

What I finally did was create a fully transparent GIF file, the same dimensions as the SWF and float that over the top within a containing DIV like this.

Code:
<div style="position:relative;">

<a href="http://www.mysite.com">
<img style="position:absolute; z-index: 1000;" src="http://www.mysite.com/images/transparent.gif" />
</a>

<object type="application/x-shockwave-flash"
 width="960" height="157"
 data="http://www.mysite.com/flash/myflash.swf">
<param name="movie"
 value="http://www.mysite.com/flash/myflash.swf" />
<param name="wmode" value="transparent" />
<img src="http://www.mysite.com/images/mystaticimage.jpg" width="960" height="157" alt="" title=""/>
</object>

</div>
Not pretty. But it works.
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Old 10-28-2010, 02:11 PM Re: How to wrap a SWF file in anchor tags??
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
I think you can do the same with a tag (without image) if you define absolute, z-index, height, width and display.
.overswf{
position: absolute;
z-index: 1000;
height: 157px;
width: 960px;
display: block;
}

<div style="position:relative;">

<a class="overswf" href="http://www.mysite.com"> </a>

<object type="application/x-shockwave-flash"
width="960" height="157"
data="http://www.mysite.com/flash/myflash.swf">
<param name="movie"
value="http://www.mysite.com/flash/myflash.swf" />
<param name="wmode" value="transparent" />
<img src="http://www.mysite.com/images/mystaticimage.jpg" width="960" height="157" alt="" title=""/>
</object>

</div>

I didn't test it but I think it will work.
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 10-28-2010, 09:27 PM Re: How to wrap a SWF file in anchor tags??
TWD
TWD's Avatar
King Spam Talker

Posts: 1,184
Trades: 0
Quote:
Originally Posted by shivaji View Post
I think you can do the same with a tag (without image) if you define absolute, z-index, height, width and display.
.overswf{
position: absolute;
z-index: 1000;
height: 157px;
width: 960px;
display: block;
}

<div style="position:relative;">

<a class="overswf" href="http://www.mysite.com"> </a>

<object type="application/x-shockwave-flash"
width="960" height="157"
data="http://www.mysite.com/flash/myflash.swf">
<param name="movie"
value="http://www.mysite.com/flash/myflash.swf" />
<param name="wmode" value="transparent" />
<img src="http://www.mysite.com/images/mystaticimage.jpg" width="960" height="157" alt="" title=""/>
</object>

</div>

I didn't test it but I think it will work.

Unfortunately it doesn't work with any version of IE or in Opera.
I even tried adding a period mark between the anchor tags but didnt work.
I think <a> tags in those browsers only take on the proportions of whatever they enclose.
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Old 10-28-2010, 10:59 PM Re: How to wrap a SWF file in anchor tags??
saint71's Avatar
Junior Talker

Posts: 3
Trades: 0
what version of IE are you using. the tags work in IE for me.
__________________

Please login or register to view this content. Registration is FREE
saint71 is offline
Reply With Quote
View Public Profile
 
Old 10-29-2010, 01:11 AM Re: How to wrap a SWF file in anchor tags??
TWD
TWD's Avatar
King Spam Talker

Posts: 1,184
Trades: 0
Quote:
Originally Posted by saint71 View Post
what version of IE are you using. the tags work in IE for me.
Tried it in both IE7 and IE8.

It's not that they don't "work", it's that the clickable area doesnt cover
the Flash movie behind it.
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Old 10-29-2010, 04:21 AM Re: How to wrap a SWF file in anchor tags??
Junior Talker

Posts: 1
Name: Allan Swagger
Location: U.S.A
Trades: 0
Thanks For sharing this useful information.keep sharing more and more in future.
Thanks & Regards
Allan Swagger
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
allanswagger is offline
Reply With Quote
View Public Profile Visit allanswagger's homepage!
 
Old 10-29-2010, 06:12 AM Re: How to wrap a SWF file in anchor tags??
Banned

Posts: 408
Name: mushget
Trades: 0
the reason for that behavior is probably that browsers usually render Flash on top of everything else on the page and also it's an activeX object.

As for your solution you can have an empty button in flash that will cover the whole stage and have it open the url you want.
If you want the url to be changing dynamically you can get flash either query the server side script on read url from an xml file, all depends on what you're trying to achieve
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
Old 10-29-2010, 07:42 AM Re: How to wrap a SWF file in anchor tags??
TWD
TWD's Avatar
King Spam Talker

Posts: 1,184
Trades: 0
Quote:
Originally Posted by mushget View Post
the reason for that behavior is probably that browsers usually render Flash on top of everything else on the page and also it's an activeX object.

As for your solution you can have an empty button in flash that will cover the whole stage and have it open the url you want.
If you want the url to be changing dynamically you can get flash either query the server side script on read url from an xml file, all depends on what you're trying to achieve
Muppet..

did you read the OP?
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Old 10-29-2010, 12:57 PM Re: How to wrap a SWF file in anchor tags??
Skilled Talker

Posts: 52
Name: Alex
Trades: 0
Quote:
Originally Posted by TWD View Post
Tried it in both IE7 and IE8.

It's not that they don't "work", it's that the clickable area doesnt cover
the Flash movie behind it.
maybe link and object should be placed on different div layers, each with absolute coordinates.
elf2002 is offline
Reply With Quote
View Public Profile
 
Old 10-30-2010, 02:27 AM Re: How to wrap a SWF file in anchor tags??
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
TWD has the answer. I use position:absolute, without top and left [only margins]
The style can be on <a> so you don't have to make 2 layers

Code:
<style type="text/css">
.overFlash { width:960px; height:157px; overflow:hidden; position:absolute;
font-size:1px; line-height:0; margin:0 /* no necessarily, but it's better */ }
.overFlash img { width:960px;height:157px;margin:0;padding:0 }
</style>

<a href="somelink" class="overFlash"><img src="blank.gif" alt="" /></a>
<object type="application/x-shockwave-flash"
........................... </object>
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 11-02-2010, 08:28 AM Re: How to wrap a SWF file in anchor tags??
Junior Talker

Posts: 1
Name: root scott
Trades: 0
interesting information, thanks
vibb is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to wrap a SWF file in anchor tags??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 6.46823 seconds with 12 queries