简体   繁体   中英

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?

I tried searching Google for this, but couldn't find anything saying either way.

Thanks

You can do this with the ExternalInterface API which allows you to execute JavaScript in the containing page from the SWF.

From the ActionScript you can do the following on the HTML page:

  • Call any JavaScript function.
  • 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.

See documentation here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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