Pretty simple:

    import flash.net.FileReference;
    class package.FileReferenceListener extends Object {
        public function FileReferenceListener () {
            super();
        }
        private function onCancel(file:FileReference):Void {
            trace("onCancel: " + file.name);
        }
        private function onOpen(file:FileReference):Void {
            trace("onOpen: " + file.name);
        }
        private function onProgress(file:FileReference,
bytesLoaded:Number, bytesTotal:Number):Void {
            trace("onProgess: " + file.name + ": " + bytesLoaded + "/" +
bytesTotal);
        }
    }

Then, elsewhere, you can do something like this:

    import flash.net.FileReference;
    import package.FileReferenceListener;
    // ...
    var file:FileReference = new FileReference();
    var listener:FileReferenceListener = new FileReferenceListener();
    file.addListener(listener);
    // Do stuff with "file".

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of human
ghaderyan
Sent: Sunday, June 25, 2006 7:34 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] FileReference and actionscript 2.0

Hi dear Hank
I think after a successfull upload and inserting in db, I can set the
record ID (or any thing else) in User Session in server and after
successful upload( returning true to flash ) call a simple remoting
method that invoke id from session and return it to flash. 
 
After all I think I don't undrestand some of key features of AS 2.0 ::
 
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);
}

I don't know where can I put event methods like this in my AS 2.0 class.
What did I misundrestand??
All the samples are in AS1 and I don't know what to do for my events :(


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to