javascript - How to control a flash film with JSjQuery - Stack Overflow

i have a project where i have a movie.swf (AS2) and some buttons with jsjQuery in the html part. Now i

i have a project where i have a 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 would do a gotoAndPlay(1) and Button2 gotoAndPlay(150) Button3 gotoAndStop(450)

The Flashmovie works with Actionscript 2.

i have a project where i have a 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 would do a gotoAndPlay(1) and Button2 gotoAndPlay(150) Button3 gotoAndStop(450)

The Flashmovie works with Actionscript 2.

Share Improve this question asked Dec 4, 2010 at 11:29 kalimerokalimero 1071 gold badge3 silver badges7 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

You need to have a look at the documentation for ExternalInterface, which provides the link between JavaScript and Flash in a webpage.

The basics run along the lines of importing the library in Flash:

import flash.external.ExternalInterface;

Then you can bind a routine to be called from Javascript by using addCallback():

ExternalInterface.addCallback('stopVideo', stopVideo);

function stopVideo() {
   ...
}

That provides a function called stopVideo() on the flash object on the webpage.

And you can call a Javascript function from Flash by using call():

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

That calls a Javascript routine called updatePlayerInfo() with the argument 'STOPPED'.

The AS3 documentation for ExternalInterface is much the same as AS2, I can not seem to locate the AS2 documentation at present.

http://livedocs.adobe./flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

external interface will assist you in this. above you'll find the adobe reference, below many questions on the subject. this is the same for AS2/AS3

ExternalInterface

Pass a callback in ExternalInterface

jQuery(this) and ExternalInterface

Is there a way to call a Javascript class method from ExternalInterface?

How to expose the JavaScript interface for an embedded Flash object?

This might be helpful to standardize how you get reference to the running swf for invoking your callbacks: jQuery SWFObject Plugin

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744789191a4593810.html

相关推荐

  • javascript - How to control a flash film with JSjQuery - Stack Overflow

    i have a project where i have a movie.swf (AS2) and some buttons with jsjQuery in the html part. Now i

    10小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信