Last active
August 29, 2015 14:06
-
-
Save honzabrecka/910c45a69d1d099fe158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stop(); | |
var loaderListener:Object = new Object(); | |
loaderListener.onLoadInit = function(swf:MovieClip):Void | |
{ | |
//for (var p in swf) trace(swf[p]); | |
channel.send("as3bridge", "loaded"); | |
}; | |
var loader:MovieClipLoader = new MovieClipLoader(); | |
loader.addListener(loaderListener); | |
var channel:LocalConnection = new LocalConnection(); | |
channel.connect("as2bridge"); | |
channel.loadFile = function(file:String):Void | |
{ | |
loader.loadClip(file, container_mc); | |
}; | |
channel.dispose = function():Void | |
{ | |
loader.unloadClip(container_mc); | |
channel.close(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client:Object = {}; | |
client.loaded = function():void | |
{ | |
trace("loaded, stage size=[" + swf.width + ";" + swf.height + "]"); | |
exportImage(name); | |
channel.send("as2bridge", "dispose"); | |
done(); | |
}; | |
client.textElement = function(x:uint, y:uint, width:uint, height:uint):void | |
{ | |
metadata = {x: x, y: y, width: width, height: height}; | |
exportMetadata(); | |
} | |
channel = new LocalConnection(); | |
channel.client = client; | |
channel.connect("as3bridge"); | |
channel.addEventListener(StatusEvent.STATUS, channel_statusHandler); | |
setTimeout(function():void | |
{ | |
channel.send("as2bridge", "loadFile", path.replace(/\\/g, "/")); | |
}, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment