Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Alex_Shim

Save loaded images

Recommended Posts

Decided to try your LoaderMax :)

var links_arr:Array = [...]

var queue:LoaderMax = new LoaderMax({name:"mainQueue", maxConnections:2, onChildComplete:currentComplete});
for (var i:uint = 0; i < links_arr.length; i++) {
    queue.append(new ImageLoader(links_arr[i], {name:"photo"+i, container:this, width:50, height:50}));
}

queue.load();


function currentComplete(event:LoaderEvent):void {
    var file:File = File.desktopDirectory.resolvePath(downloadFilename);
    var fileStream:FileStream = new FileStream();
    urlStream.readBytes(fileData, 0, urlStream.bytesAvailable);
    fileStream.open(file, FileMode.WRITE);
    fileStream.writeBytes(fileData, 0, fileData.length);
    fileStream.close();
}

The problem is that I don't know how to get URLStream of each loaded image.
The idea was to show to user loaded img thumb (resized original) and simultaneously save the original img to users hardrive.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×