www.webdeveloper.com
Results 1 to 11 of 11

Thread: <a href=""> Around a Flash Object

  1. #1
    Join Date
    May 2009
    Posts
    40

    Question <a href=""> Around a Flash Object



    OK!
    I've tried everything...
    transparent div, javascript onclick...
    Nothing worked.

    Can someone please write a code example for me which allows wrapping a flash object with a HTML link.
    I can't put the link inside the flash as it's a dynamic link.

    Appreciate any help!

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    I believe one workaround is to put an empty div over the top of the flash element with an onclick (though this will require some tweaking to windowmode etc). The best option is to handle the clicks in the flash. Do you have access to the fla?

  3. #3
    Join Date
    May 2009
    Posts
    40
    Quote Originally Posted by criterion9 View Post
    I believe one workaround is to put an empty div over the top of the flash element with an onclick (though this will require some tweaking to windowmode etc). The best option is to handle the clicks in the flash. Do you have access to the fla?
    Yeah but as I said, the link is dynamic (taken from a PO file with PHP)

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    You can have flash pass the click event to javascript in the html document pretty easily. That is why I asked if you had access to the fla or just the compiled swf.

  5. #5
    Join Date
    May 2009
    Posts
    40
    Quote Originally Posted by criterion9 View Post
    You can have flash pass the click event to javascript in the html document pretty easily. That is why I asked if you had access to the fla or just the compiled swf.
    Thanks a lot for the suggestions..
    I'm familiar with it and other options of linking flash (clickTAG) but I still need a HTML link.

    i know it is possible as I saw some do it but from their source I can't figure out exactly how.
    tried an absolute positioned div on top of the flash object with an onclick javascript (location.href="" but for some reason it didn't work.

    I thought maybe i'm doing it wrong so I'd appreciate if someone would write an example code for this...

  6. #6
    Join Date
    Jan 2009
    Posts
    3,346
    Can we see the code you tried with the div over the flash element? Maybe you had a typo or something? I know that I finally gave up fiddling with the window mode and such and just had the flash handle the click event when I was mucking about with a similar task.

  7. #7
    Join Date
    May 2009
    Posts
    40
    tried putting a link inside the same wrapper as the flash object wrapper
    gave the link a class:
    Code:
    .link-overlay  {
    	background-color: red;
    	cursor:pointer;
    	display:block;
    	height:118px;
    	opacity:0;
    	position:absolute;
    	width:487px;
    	z-index:100 !important;
    }
    also tried putting a div with
    Code:
    onclick="location.href='ADDRESS'; with/without return false;"
    none worked...

  8. #8
    Join Date
    Jan 2009
    Posts
    3,346
    How are you embedding the swf? Some window modes cause the flash element to actually render above the browser rather than mixed in with the content.

  9. #9
    Join Date
    May 2009
    Posts
    40
    Quote Originally Posted by criterion9 View Post
    How are you embedding the swf? Some window modes cause the flash element to actually render above the browser rather than mixed in with the content.
    Code:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="487" height="118" id="banner-left" align="middle">
                            <param name="wmode" value="transparent" />
                            <param name="allowScriptAccess" value="sameDomain" />
                            <param name="allowFullScreen" value="false" />
                            <param name="movie" value="shared/flash/left_487x118.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />  <embed src="shared/flash/left_487x118.swf" quality="high" bgcolor="#ffffff" width="487" height="118" name="banner-left" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
    It seems like you're right. when I play with the background color and the opacity of the overlayed link through firebug it suddenly works but then the red background appears over the flash and if you change it to transparent it stops working... weird.

  10. #10
    Join Date
    Jan 2009
    Posts
    3,346
    There is another post on this forum that illustrates the different window modes and such much clearer than I can.

  11. #11
    Join Date
    May 2009
    Posts
    40
    Thank you!
    will check that out!

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles