将 SWF 文件链接到另一个 HTML

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/445487/
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:59:50  来源:igfitidea点击:

make link on SWF File to another HTML

htmlflashactionscript

提问by Talha Bin Shakir

I am having a problem with SWF File. I have a SWF File on my HTML page and i need to link it to another HTML i used but the anchor is not working. Any one can help me. How to link a SWF file. Thanks

我遇到了 SWF 文件的问题。我的 HTML 页面上有一个 SWF 文件,我需要将它链接到我使用的另一个 HTML,但锚点不起作用。任何人都可以帮助我。如何链接 SWF 文件。谢谢

回答by Ronnie Liew

You can use SWFObject to add a flashvarlike this:

您可以使用 SWFObject 添加这样的flashvar

<script type="text/javascript">
    var flashvars = {};
    flashvars.targetURL = "http://www.stackoverflow.com";
    var params = {};
    var attributes = {};
    swfobject.embedSWF("myflashmovie.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes);
</script>

That being said, this is assuming that within your Flash movie, it is coded such that the Flash movie is expecting that flashvarand using that link to the stipulated URL

话虽如此,这是假设在您的 Flash 电影中,它的编码使得 Flash 电影期待该flashvar并使用该链接到规定的 URL

In AS 2.0 it would be:

在 AS 2.0 中,它将是:

getURL(_root.targetURL);



In AS 3.0 it would be:

在 AS 3.0 中,它将是:

var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
var linkURL = flashvars['targetURL']; 
var link:URLRequest = new URLRequest (linkURL);
navigateToURL(link);

回答by rich

I think I fixed it. Here is what I did:

我想我修好了。这是我所做的:

  1. made a clear png graphic the same size as the area you want your flash video to be in

  2. make a new layer (div tag) over the flash video - you must be in standard view to edit layers - layers are like tables: they hold images,text, etc.(beware: if you are using tables, the div tag will float over the table when you resize your browser)

  3. add the blank png into the new layer

  4. link the blank png using the properties window in dreamweaver!

  5. Within your object tag that holds the flash object add this line of code . This sets the background of your flash movie to transparent and allows the png layer to be placed above it. If you still need your flash movie to have a background, just create a colored box in your flash movie and use it as a background.

  1. 制作一个清晰的 png 图形,大小与您希望 Flash 视频所在的区域相同

  2. 在 Flash 视频上创建一个新图层(div 标签) - 您必须在标准视图中编辑图层 - 图层就像表格:它们包含图像、文本等(注意:如果您使用的是表格,div 标签将浮动调整浏览器大小时在表格上方)

  3. 将空白 png 添加到新图层中

  4. 使用 Dreamweaver 中的属性窗口链接空白 png!

  5. 在保存 flash 对象的对象标记中添加这行代码。这会将 Flash 电影的背景设置为透明,并允许将 png 图层放置在其上方。如果您仍然需要您的 Flash 影片有背景,只需在您的 Flash 影片中创建一个彩色框并将其用作背景。

回答by maryam

onmouseup do the job like(not exactly the same) click, It works for me. because onclick does not work there.

onmouseup 做的工作就像(不完全一样)点击,它对我有用。因为 onclick 在那里不起作用。

object type="application/x-shockwave-flash" **onmouseup="document.location='http://www.mysite.com';"**> 
<param name="wmode" value="transparent" />
<param name="movie" value="101.swf" />
</object>

回答by Jason Miesionczek

Here is a link to a blog post about how to navigate to a url through flash:

这是一篇关于如何通过 Flash 导航到 url 的博客文章的链接:

Linking to url in action script 3

链接到动作脚本 3 中的 url

回答by user2991535

you can also add javascript command but onclick does not work because it is already preset. by using onmouseover command will do the trick but do you want to do it that way? if so

您也可以添加 javascript 命令,但 onclick 不起作用,因为它已经预设。通过使用 onmouseover 命令可以解决问题,但您想这样做吗?如果是这样的话

`<object type="application/x-shockwave-flash" onMouseOver="parent.location='http://www.mysite.com'"> <param name="wmode" value="transparent" /><param name="movie" value="101.swf" /></object>