On Jun 6, 2008, at 4:26 AM, David Pariente wrote:
The point is that, IN ANOTHER POINT OF THE CODE, i wanna send the
files.
the on_select is not useful for me. i will not send anything
on_select, just put a pair of lines of code there.
My opinion is that you are thinking about this too much. You do not
need to have a boolean to determine if a file was selected.
What you need is an array that you populate with the filled
FileReference instances in the Event.SELECTED event handler. When the
user clicks SEND on your application, you loop over your array of
stored FileReference instances and upload each of them.
So in the onSelect function for Event.SELECTED, just push the
FileReference into the array. Event.SELECTED shouldn't get broadcast
unless a file is actually selected anyway.
Whether or not your FileReference elements are stored in different
views doesn't matter - just so long as your array is accessible by
all of them so the FileReference instance can be added.
private var fileList:Array = new Array();
private function onSelectFile(event:Event):void
{
var file:FileReference = FileReference(event.target);
fileList.push(file);
}
jon