Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use a flash object as a link?

Tags:

html

flash

Is it possible to use a flash document embedded in HTML as a link?

I tried just wrapping the object element with an a like this:

<a href="http://whatever.com">
    <object ...>
        <embed ... />
    </object>
</a>

In Internet Explorer, that made it show the location in the status bar like a link, but it doesn't do anything.

I just have the .swf file, so I can't add a click handler in ActionScript.

like image 801
Matthew Crumley Avatar asked Aug 28 '08 21:08

Matthew Crumley


3 Answers

You can use transparent div with same height and width over that object. And let javascript open your url on click action on that div.

like image 97
Lukas Avatar answered Sep 20 '22 13:09

Lukas


Though the object really should respond to being wrapped in an a href tag, you could open the swf in vim and just throw in an _root.onPress=function(){getURL("http://yes.no/");}; or if it's AS3, something like _root.addEventHandler(MouseEvent.PRESS, function (e:event) {getURL("http://yes.no/");}); But if editing the swf is your route, you'd likely have more success with a tool for the purpose.

like image 22
dlamblin Avatar answered Sep 19 '22 13:09

dlamblin


You could use Javascript to add a handler (added inline for brevity):

<object onclick="window.location='URLHERE'; return false;">

That should work, methinks.

This worked for me but the litle hand for clicking stuff doesn´t appear. The link works though

like image 43
s0natagrl Avatar answered Sep 22 '22 13:09

s0natagrl