Yes it is possible to upload Image in Flash Player 10 without use of server side scripting language

Today,I was just going through image upload process and I was amazed that we can upload the image in FP10 without use of any server side scripting language like PHP or ASP.The following code will give some idea on how this is possible

Consider you have a button named loadBtn on your stage

//this FileReference class has added the power to load and save images at runtime without any server side scripting language
var fileRef:FileReference;
var loader:Loader;
function goLoadImage(e:MouseEvent):void
fileRef = new FileReference();
//we need FileFilter so that while choosing image we can list out our needed file like jpg or png or gif or all
var fileFilter:FileFilter = new FileFilter("images","*.jpg;*.png.*.gif");
//now we use FileReference with FileFilter to browse the required images
//now we have to write an event handler function when user selects any image
function imageSelected(e:Event):void
//now make the FileReference to load the selected file
function loadImage(e:Event):void
//the data thus loaded is in ByteArray so we have to use it like this
var ba:ByteArray =;
//and we use loader to load that byte Array
loader = new Loader();
function imageLoaded(e:Event):void
//the content of Loader is now takes as Bitmap and added to stage
var btmp:Bitmap = as Bitmap;

Isn’t this so simple and thanks to FP10 new feature.

If you want more advanced way to deal with image upload,look at this post


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s