joon
joon

Reputation: 864

Is getting the time of an AS3 MovieClip in JavaScript, possible?

Just a quick feasbility question. We're discussing a custom AS3 movie player which will be on a non-flash page that shows different information depending on the time of the video.

If I were to research getting info from a flash clip in JS through AJAX or something else, where would I start?

Upvotes: 0

Views: 141

Answers (1)

jbreicis
jbreicis

Reputation: 588

You start with ActionScript to JavaScript communication. There is a thing in AS3 - ExternalInterface which provides this functionality.

Then what you should do is to create a JS accessable EventHandler in AS by publishing it from AS towards webpage by

ExternalInterface.addCallback("addEventListener", yourEventDispatcher.addEventListerener);

Then, when a movie is played, you just dispatch events to yourEventDispatcher which in return passes them to JS by

ExternalInterface.call(JSFunctionName_from_addEvenet_Listener_call, EventData);

Hope, you get the idea; it is really simple.

Upvotes: 2

Related Questions