How to manage flash movie using JS / jQuery

I have a project in which I have movie.swf (AS2) and some buttons with js / jQuery in the html part. Now I want the buttons to control the flash. For example, pressing Button1 will do gotoAndPlay (1) and Button2 gotoAndPlay (150) Button3 gotoAndStop (450)

Flashmovie works with ActionScript 2.

+5
source share
3 answers

You need to look at the documentation for ExternalInterface, which provides a link between JavaScript and Flash on a web page.

The basics run along the import lines of a library in Flash:

import flash.external.ExternalInterface;

, Javascript, addCallback():

ExternalInterface.addCallback('stopVideo', stopVideo);

function stopVideo() {
   ...
}

, stopVideo() - -.

Javascript Flash call():

ExternalInterface.call('updatePlayerInfo', "STOPPED");

Javascript- updatePlayerInfo() 'STOPPED'.

AS3 ExternalInterface , AS2, AS2.

+4

This can be useful for standardizing how you get a link to an executable swf to call your callbacks: jQuery SWFObject Plugin

0
source

All Articles