Html 您如何使用 Flash 对象作为链接?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33459/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:10:01  来源:igfitidea点击:

How do you use a flash object as a link?

htmlflash

提问by Matthew Crumley

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

是否可以使用嵌入在 HTML 中的 Flash 文档作为链接?

I tried just wrapping the objectelement with an alike this:

我试着objecta这样的方式包装元素:

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

在 Internet Explorer 中,这使它像链接一样在状态栏中显示位置,但它不执行任何操作。

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

我只有 .swf 文件,因此无法在 ActionScript 中添加单击处理程序。

采纳答案by dlamblin

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.

尽管该对象确实应该响应被包装在一个 href 标签中,但您可以在 vim 中打开 swf 并只放入一个_root.onPress=function(){getURL("http://yes.no/");};或者如果它是 AS3,例如_root.addEventHandler(MouseEvent.PRESS, function (e:event) {getURL("http://yes.no/");});但如果编辑 swf 是您的路线,您可能会取得更大的成功以工具为目的

回答by Lukas

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.

您可以在该对象上使用具有相同高度和宽度的透明 div。并让 javascript 在该 div 上的单击操作上打开您的 url。

回答by s0natagrl

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

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

That should work, methinks.

您可以使用 Javascript 添加处理程序(为简洁起见添加内联):

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

我想,那应该有用。

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

这对我有用,但没有出现点击东西的小手。该链接虽然有效

回答by Tim Saunders

As an addition to dlamblin's answer it is often best to use the clickTAG technique to open URLS from a flash movie.

作为 dlamblin 答案的补充,通常最好使用 clickTAG 技术从 Flash 电影中打开 URL。

More information can be found here:

更多信息可以在这里找到:

http://www.adobe.com/resources/richmedia/tracking/designers_guide/

http://www.adobe.com/resources/richmedia/tracking/designers_guide/

The advantage of using the clickTAG technique is that you can set the URL to jump to in the HTML page.

使用 clickTAG 技术的优点是您可以在 HTML 页面中设置要跳转到的 URL。

This means that you can set the flash movie to link to different places without modifying the flash file (beyond adding the initial clickTAG code). You can use link tracking on the URL as well.

这意味着您可以将 flash 电影设置为链接到不同的地方,而无需修改 flash 文件(除了添加初始 clickTAG 代码)。您也可以在 URL 上使用链接跟踪。