Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling a Flash Player using JavaScript

I would like to be able to control a flash movie stream using JavaScript in the same pages as the flash component including:

  • Play and Pause stream
  • Change Stream

I can already load the player and set the flash args, but I don't know how to interact with the player once the stream has started. Is this possible without modifying the SWF that is currently used to play the movie?

Mike.

like image 792
Michael Barker Avatar asked Nov 29 '08 23:11

Michael Barker


People also ask

Does flash use JavaScript?

ActionScript is used in Flash and, thus, has the same pitfall of SWF files mentioned earlier, in that it requires the Flash plugin. JavaScript, on the other hand, is readily available in all modern browsers.

Can you convert Flash to HTML5?

There are multiple tools that you can use for Flash to HTML5 conversion, including Adobe Captivate, Lectora Inspire, Adobe Wallaby, Google Swiffy, Sothink – Flash to HTML5 conversion tool, Apache FlexJS and Articulate Storyline. It is a free web editor for Flash to HTML5 conversion.

What is Flash JavaScript?

Flash. js is a simple JavaScript library allowing you to create and handle HTML flash messages. You can try it yourself here.

How can add Flash file in HTML?

Choose File > Publish. Flash will now create the <object>, <param>, and <embed> tags for you. It will also create the classid and pluginspage attributes. Open the HTML document that Flash created, view the HTML source, and copy the code into your HTML page where you want your Flash movie.


2 Answers

The SWF needs to expose functions to Javascript using the ExternalInterface API from the Flash libraries. This allows Javascript to call into Flash and vice-versa.

http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html

like image 177
cliff.meyers Avatar answered Sep 21 '22 10:09

cliff.meyers


"Is this possible without modifying the SWF that is currently used to play the movie" .. it's only possible if the SWF you are using implements the ExternalInterface with documented functions suitable to your needs - as described by cliff.meyers ... otherwise, .... no

like image 36
Scott Evernden Avatar answered Sep 19 '22 10:09

Scott Evernden