Hi, I have this file which it's supposed to be able to download image when I upload to server.
Can anyone help me check if the codes is correct? Cause I'm really not very sure about it.
Much appreciated.
Printable View
Hi, I have this file which it's supposed to be able to download image when I upload to server.
Can anyone help me check if the codes is correct? Cause I'm really not very sure about it.
Much appreciated.
Can someone kindly help out? :(
really need to know if it's the correct way (I used getURL) but it doesn't seem to work.
when you press one of the buttons (eg) "1280x1024" ..do you want it to bring a dialog box saying. save ?
if so :
remove the geturl from the button and frame
place this where you had the 'image.onRelease' frame
Code:image.onRelease = function() {
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "coke.jpg";
if(!fileRef.download(url)) {
trace("dialog box failed to open.");
}
}