开发者

Can I detect dom event from swf

I've been developing a swf with Adobe CS4.

My problem is the following:

<a href="#" onclick="jsonp_func();return false" >click</a>
var jsonp_func = function(){
  var script = document.createElement('script');
  script.type = "text/javascript"; 
  script开发者_开发技巧.src = "http://example.com/api?callback=jsonp_callback";
  document.body.appendChild(script);
};

function jsonp_callback(data){
   //I wanna take the data to swf
}

How to send the data to swf?


You can use SetVariable or ExternalInterface

Demo: http://oddhammer.com/tutorials/firefox_setvariable/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜