开发者

Creating a JavaScript Click Event to Queue Flash Animation

Greetings! I need to create a java/html button that, when pressed, queues my flash animation to begin. I believe I understand how it works on the AS3/ExternalInterface end, but I am unable to test it as I do not know how to properly code something 开发者_运维知识库to test it with on the Javascript end. Any help would be much appreciated! :)


http://kb2.adobe.com/cps/156/tn_15683.html#main_Defining_JavaScript_for_ExternalInterface_example


call this function on your clicke event.
change ${application} to your swfs name.
btn_clicked is the callback function name inside your swf

function doCLick( ){
  var swf = "${application}";
  var container;
  if (navigator.appName.indexOf("Microsoft") >= 0){
    container = document;
  }else{
    container = window;
  }
  var result = container[swf].btn_clicked();
}

ExternalInterface has issues with running as local content so you may have to upload it to your sever to test.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜