javascript 中使用 addEventListener 监听 flash 事件
var flash = { types: { }, event: function( type ) { var listeners = this.types[type]; if( listeners ) { for( var i = 0; i < listeners.length; ++i ) { listeners[i](); } } }, addEventListener: function( type, fn ) { if( !this.types[type] ) { this.types[type] = []; } this.types[type].push(fn); } }; flash.addEventListener( "progress", function(){ });
ExternalInterface.call( "flash.event", "progress"); ExternalInterface.call( "flash.event", "loaded"); //Etc