Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Flash ActionScript Uploading File - Browse for File

The first step thinking to use Flash ActionScript to upload file is how to open a dialog box and able to browse user local disk for a file. This can be done with the Flash ActionScript browse() method.

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

With Flash ActionScript browse() method, we are able to select a file to upload.

The Flash Movie of this tutorial is shown as above.

Flash ActionScript Codes:

// Create a new instance of the FileReference class to work with.
var myfileReference:FileReference = new FileReference();

 

function browseFile (event:MouseEvent):void {

// Use browse( ) method of a FileReference object to open a
// dialog box to browse local disks for a file.
myfileReference.browse();

}

// Hook up the button with the function browseFile
browse_btn.addEventListener(MouseEvent.CLICK, browseFile);

Download Flash Source File:

Flash Source File as3-upload-file-01.fla

Remarks:

This Flash ActionScript tutorial shows how to use browse() method to select a file to upload.