views:

1266

answers:

2

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.

+4  A: 

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

cliff.meyers
Beware that Flash player 10 really hampers the ability of Javascript to control a movie directly via Javascript / ExternalInterface. It's a new "security enhancement". It can be done, but make sure you test on Flash 10 if you try.
Chris
A: 

"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

Scott Evernden