开发者

Can I detect dom event from swf

开发者 https://www.devze.com 2023-01-24 16:37 出处:网络
I\'ve been developing a swf with Adobe CS4. My problem is the following: <a href=\"#\" onclick=\"jsonp_func();return false\" >click</a>

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

精彩评论

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