简体   繁体   English

Flash Player(AS3)和HTML属性

[英]Flash Player (AS3) and HTML attributes

I'm curious, is it possible for a flash player (SWF) object on an HTML page to update the HTML attributes directly, or would I have to use a script to accomplish this? 我很好奇,HTML页面上的Flash Player(SWF)对象是否可以直接更新HTML属性,还是我必须使用脚本来完成此操作?

I tried searching Google for this, but couldn't find anything saying either way. 我尝试在Google上搜索此内容,但是找不到任何一种说法。

Thanks 谢谢

You can do this with the ExternalInterface API which allows you to execute JavaScript in the containing page from the SWF. 您可以使用ExternalInterface API进行此操作,该API允许您从SWF在包含页面中执行JavaScript。

From the ActionScript you can do the following on the HTML page: 在ActionScript中,您可以在HTML页面上执行以下操作:

  • Call any JavaScript function. 调用任何JavaScript函数。
  • Pass any number of arguments, with any names. 传递任意数量的参数和名称。
  • Pass various data types (Boolean, Number, String, and so on). 传递各种数据类型(布尔,数字,字符串等)。
  • Receive a return value from the JavaScript function. 从JavaScript函数接收返回值。

See documentation here . 请参阅此处的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM