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/
精彩评论