Re: [flexcoders] Re: Return data to FileReference

2008-06-23 Thread Rich Tretola
Worked as expected.

Thanks to all of you.

On Sun, Jun 22, 2008 at 7:34 PM, Rich Tretola [EMAIL PROTECTED] wrote:
 I will try this Monday morning and let you all know how it works out.

 Thanks
 Rich

 On Fri, Jun 20, 2008 at 8:35 PM, Tracy Spratt [EMAIL PROTECTED] wrote:
 Yeah, I should be using DataEvent.UPLOAD_COMPLETE_DATA, but I am not, I am
 using Event.COMPLETE, but I am still getting access to the .data Property
 and am seeing my XML status returned correctly.



 As Doug pointed out, this may just be a lucky coincidence.  At any rate, I
 think Rich's problem is solved, and I will correct my code to use the the
 correct event.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Santiago Gonzales
 Sent: Friday, June 20, 2008 7:24 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Return data to FileReference



 I think he is referring to the two different types of events that you
 can listen for on a FileReference.

 1) Event.COMPLETE which does not have a data property (Event Class)

 and

 2) DataEvent.UPLOAD_COMPLETE_DATA which does have the property
 (DataEvent Class)

 Both are in the docs for file reference.

 --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Are you saying, complete event is of type flash.events.Event and does
 not have a data property... because of the docs? (which do not list a
 data property)



 Because I am not proposing a theoretical solution, this is operating
 code. I am a bit confused, though about the event datatypes. While I
 am listening for flash.events.Event from Filereference, my listener is
 typing the argument as DataEvent, and no exception is thrown, and I can
 access the .data property.



 Per the docs, flash.events.DataEvent.UPLOAD_COMPLETE_DATA
 http://127.0.0.1:54009/help/nftopic/com.adobe.flexbuilder.help/langref/
 flash/events/DataEvent.html#UPLOAD_COMPLETE_DATA  is the correct event
 to use.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 2:41 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 OK, the problem with your solution is that the FileReference complete
 event is of type flash.events.Event and does not have a data property
 and the target is the FileReference.




 On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:

 I just verified it, my handler is working as expected and I can access
 the xml status node I am having the server return.

 Tracy



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:58 PM


 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 Hmm, looks like I am just using the Event.COMPLETE event. Its been
 awhile since I ran this code, let me double check it.

 Tracy



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:55 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 The event.result should contain whatever your server sends back, just
 like with a normal httpservice request. Below is the code I am using.
 I send back an xml status node, but you could send anything:

 Tracy



 // Called on upload complete

 private function onUploadComplete(event:DataEvent):void {

 var sData:String = event.data;

 var xmlStatus:XML = XML(sData);

 if ([EMAIL PROTECTED] == error) {

 this.height = 200;

 lbStatus.setStyle(color,red);

 lbStatus.text = Error Uploading File:;

 txtError.text = [EMAIL PROTECTED];

 sCloseMode = ioerror

 //_timerStatus.delay = 6000;

 //_timerStatus.start()

 }

 else {

 _numCurrentUpload++;

 if (_numCurrentUpload  _aUploadFiles.length) {

 startUpload(false);

 } else {

 lbStatus.text = Upload successful;

 sCloseMode = success

 _timerStatus.start()

 }

 saveProjDoc();

 }

 }//onUploadComplete



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 1:16 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 Yes, but that file name is the name that was selected by the user, not
 the one that the file was actually renamed to by the servlet.





 On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
 mailto

Re: [flexcoders] Re: Return data to FileReference

2008-06-22 Thread Rich Tretola
I will try this Monday morning and let you all know how it works out.

Thanks
Rich

On Fri, Jun 20, 2008 at 8:35 PM, Tracy Spratt [EMAIL PROTECTED] wrote:
 Yeah, I should be using DataEvent.UPLOAD_COMPLETE_DATA, but I am not, I am
 using Event.COMPLETE, but I am still getting access to the .data Property
 and am seeing my XML status returned correctly.



 As Doug pointed out, this may just be a lucky coincidence.  At any rate, I
 think Rich's problem is solved, and I will correct my code to use the the
 correct event.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Santiago Gonzales
 Sent: Friday, June 20, 2008 7:24 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Return data to FileReference



 I think he is referring to the two different types of events that you
 can listen for on a FileReference.

 1) Event.COMPLETE which does not have a data property (Event Class)

 and

 2) DataEvent.UPLOAD_COMPLETE_DATA which does have the property
 (DataEvent Class)

 Both are in the docs for file reference.

 --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Are you saying, complete event is of type flash.events.Event and does
 not have a data property... because of the docs? (which do not list a
 data property)



 Because I am not proposing a theoretical solution, this is operating
 code. I am a bit confused, though about the event datatypes. While I
 am listening for flash.events.Event from Filereference, my listener is
 typing the argument as DataEvent, and no exception is thrown, and I can
 access the .data property.



 Per the docs, flash.events.DataEvent.UPLOAD_COMPLETE_DATA
 http://127.0.0.1:54009/help/nftopic/com.adobe.flexbuilder.help/langref/
 flash/events/DataEvent.html#UPLOAD_COMPLETE_DATA  is the correct event
 to use.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 2:41 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 OK, the problem with your solution is that the FileReference complete
 event is of type flash.events.Event and does not have a data property
 and the target is the FileReference.




 On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:

 I just verified it, my handler is working as expected and I can access
 the xml status node I am having the server return.

 Tracy



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:58 PM


 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 Hmm, looks like I am just using the Event.COMPLETE event. Its been
 awhile since I ran this code, let me double check it.

 Tracy



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:55 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 The event.result should contain whatever your server sends back, just
 like with a normal httpservice request. Below is the code I am using.
 I send back an xml status node, but you could send anything:

 Tracy



 // Called on upload complete

 private function onUploadComplete(event:DataEvent):void {

 var sData:String = event.data;

 var xmlStatus:XML = XML(sData);

 if ([EMAIL PROTECTED] == error) {

 this.height = 200;

 lbStatus.setStyle(color,red);

 lbStatus.text = Error Uploading File:;

 txtError.text = [EMAIL PROTECTED];

 sCloseMode = ioerror

 //_timerStatus.delay = 6000;

 //_timerStatus.start()

 }

 else {

 _numCurrentUpload++;

 if (_numCurrentUpload  _aUploadFiles.length) {

 startUpload(false);

 } else {

 lbStatus.text = Upload successful;

 sCloseMode = success

 _timerStatus.start()

 }

 saveProjDoc();

 }

 }//onUploadComplete



 

 From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
 On Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 1:16 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 Yes, but that file name is the name that was selected by the user, not
 the one that the file was actually renamed to by the servlet.





 On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:

 You can get the event.result data in a handler for the
 uploadCompleteData event.



 http

RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
You can get the event.result data in a handler for the
uploadCompleteData event.

 

http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#
event:uploadCompleteData

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Return data to FileReference

 

I guess no one else has run into this before?




On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is the situation:

I am uploading files from Flex to a Servlet using the FileReferenceList
class. Since there is no way to change the filename before it is
uploaded, I am passing along a parameter which holds the file name I
would like the file to ultimately be saved as. 

On the server side, all is well. The file is uploaded and then renamed
to my parameter name.

So my question is, is there a way to pass the new filename back to Flex
so that I can access it within the FileReference Event.COMPLETE event
listener?

Rich

 

 



Re: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Rich Tretola
Yes, but that file name is the name that was selected by the user, not the
one that the file was actually renamed to by the servlet.



On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

You can get the event.result data in a handler for the
 uploadCompleteData event.




 http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#event:uploadCompleteData



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Rich Tretola
 *Sent:* Friday, June 20, 2008 1:01 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Return data to FileReference



 I guess no one else has run into this before?


  On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
 wrote:

 Here is the situation:

 I am uploading files from Flex to a Servlet using the FileReferenceList
 class. Since there is no way to change the filename before it is uploaded, I
 am passing along a parameter which holds the file name I would like the file
 to ultimately be saved as.

 On the server side, all is well. The file is uploaded and then renamed to
 my parameter name.

 So my question is, is there a way to pass the new filename back to Flex so
 that I can access it within the FileReference Event.COMPLETE event listener?

 Rich



  



RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
The event.result should contain whatever your server sends back, just
like with a normal httpservice request.  Below is the code I am using.
I send back an xml status node, but you could send anything:

Tracy

 

  // Called on upload complete

  private function onUploadComplete(event:DataEvent):void {

var sData:String = event.data;

var xmlStatus:XML = XML(sData);

if ([EMAIL PROTECTED] == error) {

  this.height = 200;

  lbStatus.setStyle(color,red);

  lbStatus.text = Error Uploading File:;

  txtError.text = [EMAIL PROTECTED];

  sCloseMode = ioerror

  //_timerStatus.delay = 6000;

  //_timerStatus.start()  

}

else {

  _numCurrentUpload++;

  if (_numCurrentUpload  _aUploadFiles.length) {

startUpload(false);

  } else {

lbStatus.text = Upload successful;

sCloseMode = success

_timerStatus.start()

  } 

  saveProjDoc(); 

}

  }//onUploadComplete

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:16 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Return data to FileReference

 

Yes, but that file name is the name that was selected by the user, not
the one that the file was actually renamed to by the servlet.




On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

You can get the event.result data in a handler for the
uploadCompleteData event.

 

http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#
event:uploadCompleteData
http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html
#event:uploadCompleteData 

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:01 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] Re: Return data to FileReference

 

I guess no one else has run into this before?



On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is the situation:

I am uploading files from Flex to a Servlet using the FileReferenceList
class. Since there is no way to change the filename before it is
uploaded, I am passing along a parameter which holds the file name I
would like the file to ultimately be saved as. 

On the server side, all is well. The file is uploaded and then renamed
to my parameter name.

So my question is, is there a way to pass the new filename back to Flex
so that I can access it within the FileReference Event.COMPLETE event
listener?

Rich

 

 

 



RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
Hmm, looks like I am just using the Event.COMPLETE event.  Its been
awhile since I ran this code, let me double check it.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, June 20, 2008 1:55 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Return data to FileReference

 

The event.result should contain whatever your server sends back, just
like with a normal httpservice request.  Below is the code I am using.
I send back an xml status node, but you could send anything:

Tracy

 

  // Called on upload complete

  private function onUploadComplete(event:DataEvent):void {

var sData:String = event.data;

var xmlStatus:XML = XML(sData);

if ([EMAIL PROTECTED] == error) {

  this.height = 200;

  lbStatus.setStyle(color,red);

  lbStatus.text = Error Uploading File:;

  txtError.text = [EMAIL PROTECTED];

  sCloseMode = ioerror

  //_timerStatus.delay = 6000;

  //_timerStatus.start()  

}

else {

  _numCurrentUpload++;

  if (_numCurrentUpload  _aUploadFiles.length) {

startUpload(false);

  } else {

lbStatus.text = Upload successful;

sCloseMode = success

_timerStatus.start()

  } 

  saveProjDoc(); 

}

  }//onUploadComplete

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:16 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Return data to FileReference

 

Yes, but that file name is the name that was selected by the user, not
the one that the file was actually renamed to by the servlet.





On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

You can get the event.result data in a handler for the
uploadCompleteData event.

 

http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#
event:uploadCompleteData
http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html
#event:uploadCompleteData 

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:01 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] Re: Return data to FileReference

 

I guess no one else has run into this before?




On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is the situation:

I am uploading files from Flex to a Servlet using the FileReferenceList
class. Since there is no way to change the filename before it is
uploaded, I am passing along a parameter which holds the file name I
would like the file to ultimately be saved as. 

On the server side, all is well. The file is uploaded and then renamed
to my parameter name.

So my question is, is there a way to pass the new filename back to Flex
so that I can access it within the FileReference Event.COMPLETE event
listener?

Rich

 

 

 



RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
I just verified it, my handler is working as expected and I can access
the xml status node I am having the server return.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, June 20, 2008 1:58 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Return data to FileReference

 

Hmm, looks like I am just using the Event.COMPLETE event.  Its been
awhile since I ran this code, let me double check it.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, June 20, 2008 1:55 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Return data to FileReference

 

The event.result should contain whatever your server sends back, just
like with a normal httpservice request.  Below is the code I am using.
I send back an xml status node, but you could send anything:

Tracy

 

  // Called on upload complete

  private function onUploadComplete(event:DataEvent):void {

var sData:String = event.data;

var xmlStatus:XML = XML(sData);

if ([EMAIL PROTECTED] == error) {

  this.height = 200;

  lbStatus.setStyle(color,red);

  lbStatus.text = Error Uploading File:;

  txtError.text = [EMAIL PROTECTED];

  sCloseMode = ioerror

  //_timerStatus.delay = 6000;

  //_timerStatus.start()  

}

else {

  _numCurrentUpload++;

  if (_numCurrentUpload  _aUploadFiles.length) {

startUpload(false);

  } else {

lbStatus.text = Upload successful;

sCloseMode = success

_timerStatus.start()

  } 

  saveProjDoc(); 

}

  }//onUploadComplete

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:16 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Return data to FileReference

 

Yes, but that file name is the name that was selected by the user, not
the one that the file was actually renamed to by the servlet.






On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

You can get the event.result data in a handler for the
uploadCompleteData event.

 

http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#
event:uploadCompleteData
http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html
#event:uploadCompleteData 

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:01 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] Re: Return data to FileReference

 

I guess no one else has run into this before?





On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is the situation:

I am uploading files from Flex to a Servlet using the FileReferenceList
class. Since there is no way to change the filename before it is
uploaded, I am passing along a parameter which holds the file name I
would like the file to ultimately be saved as. 

On the server side, all is well. The file is uploaded and then renamed
to my parameter name.

So my question is, is there a way to pass the new filename back to Flex
so that I can access it within the FileReference Event.COMPLETE event
listener?

Rich

 

 

 



Re: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Joseph Balderson
Without having done it myself, I would say off the top of my head no, 
because the Event class (flash.events.Event.COMPLETE) does not contain 
user-settable data.

But you may be able to do it indirectly, by creating a custom property 
fileName on the server-side dispatching object, and then using 
event.target.fileName on the client-side ...?


___

Joseph Balderson, Flash Platform Developer | http://joeflash.ca


Rich Tretola wrote:
 I guess no one else has run into this before?
 
 
 
 On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 Here is the situation:
 
 I am uploading files from Flex to a Servlet using the
 FileReferenceList class. Since there is no way to change the
 filename before it is uploaded, I am passing along a parameter which
 holds the file name I would like the file to ultimately be saved as.
 
 On the server side, all is well. The file is uploaded and then
 renamed to my parameter name.
 
 So my question is, is there a way to pass the new filename back to
 Flex so that I can access it within the FileReference Event.COMPLETE
 event listener?
 
 Rich
 
 
 


RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
Are you saying, complete event is of type flash.events.Event and does
not have a data property... because of the docs?  (which do not list a
data property)

 

Because I am not proposing a theoretical solution, this is operating
code.  I am a bit confused, though about the event datatypes.  While I
am listening for flash.events.Event from Filereference, my listener is
typing the argument as DataEvent, and no exception is thrown, and I can
access the .data property.

 

Per the docs, flash.events.DataEvent.UPLOAD_COMPLETE_DATA
http://127.0.0.1:54009/help/nftopic/com.adobe.flexbuilder.help/langref/
flash/events/DataEvent.html#UPLOAD_COMPLETE_DATA  is the correct event
to use.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 2:41 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: Return data to FileReference

 

OK, the problem with your solution is that the FileReference complete
event is of type flash.events.Event and does not have a data property
and the target is the FileReference.




On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

I just verified it, my handler is working as expected and I can access
the xml status node I am having the server return.

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Tracy Spratt
Sent: Friday, June 20, 2008 1:58 PM


To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: RE: [flexcoders] Re: Return data to FileReference

 

Hmm, looks like I am just using the Event.COMPLETE event.  Its been
awhile since I ran this code, let me double check it.

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Tracy Spratt
Sent: Friday, June 20, 2008 1:55 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: RE: [flexcoders] Re: Return data to FileReference

 

The event.result should contain whatever your server sends back, just
like with a normal httpservice request.  Below is the code I am using.
I send back an xml status node, but you could send anything:

Tracy

 

  // Called on upload complete

  private function onUploadComplete(event:DataEvent):void {

var sData:String = event.data;

var xmlStatus:XML = XML(sData);

if ([EMAIL PROTECTED] == error) {

  this.height = 200;

  lbStatus.setStyle(color,red);

  lbStatus.text = Error Uploading File:;

  txtError.text = [EMAIL PROTECTED];

  sCloseMode = ioerror

  //_timerStatus.delay = 6000;

  //_timerStatus.start()  

}

else {

  _numCurrentUpload++;

  if (_numCurrentUpload  _aUploadFiles.length) {

startUpload(false);

  } else {

lbStatus.text = Upload successful;

sCloseMode = success

_timerStatus.start()

  } 

  saveProjDoc(); 

}

  }//onUploadComplete

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:16 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: Re: [flexcoders] Re: Return data to FileReference

 

Yes, but that file name is the name that was selected by the user, not
the one that the file was actually renamed to by the servlet.





On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

You can get the event.result data in a handler for the
uploadCompleteData event.

 

http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#
event:uploadCompleteData
http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html
#event:uploadCompleteData 

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Rich Tretola
Sent: Friday, June 20, 2008 1:01 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] Re: Return data to FileReference

 

I guess no one else has run into this before?




On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Here is the situation:

I am uploading files from Flex to a Servlet using the FileReferenceList
class. Since there is no way to change the filename before it is
uploaded, I am passing along a parameter which holds the file name I
would like the file to ultimately be saved as. 

On the server side, all is well. The file is uploaded and then renamed
to my parameter name.

So my question

Re: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Doug McCune
I'm guessing then that Event.COMPLETE and
DataEvent.UPLOAD_COMPLETE_DATA both are the string complete and you
just happened to get lucky with a bad naming convention. But that's
just a guess.

Doug

On Fri, Jun 20, 2008 at 4:19 PM, Tracy Spratt [EMAIL PROTECTED] wrote:
 Are you saying, complete event is of type flash.events.Event and does not
 have a data property… because of the docs?  (which do not list a data
 property)



 Because I am not proposing a theoretical solution, this is operating code.
 I am a bit confused, though about the event datatypes.  While I am listening
 for flash.events.Event from Filereference, my listener is typing the
 argument as DataEvent, and no exception is thrown, and I can access the
 .data property.



 Per the docs, flash.events.DataEvent.UPLOAD_COMPLETE_DATA is the correct
 event to use.



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 2:41 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 OK, the problem with your solution is that the FileReference complete event
 is of type flash.events.Event and does not have a data property and the
 target is the FileReference.


 On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

 I just verified it, my handler is working as expected and I can access the
 xml status node I am having the server return.

 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:58 PM

 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 Hmm, looks like I am just using the Event.COMPLETE event.  Its been awhile
 since I ran this code, let me double check it.

 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:55 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: Return data to FileReference



 The event.result should contain whatever your server sends back, just like
 with a normal httpservice request.  Below is the code I am using.  I send
 back an xml status node, but you could send anything:

 Tracy



   // Called on upload complete

   private function onUploadComplete(event:DataEvent):void {

 var sData:String = event.data;

 var xmlStatus:XML = XML(sData);

 if ([EMAIL PROTECTED] == error) {

   this.height = 200;

   lbStatus.setStyle(color,red);

   lbStatus.text = Error Uploading File:;

   txtError.text = [EMAIL PROTECTED];

   sCloseMode = ioerror

   //_timerStatus.delay = 6000;

   //_timerStatus.start()

 }

 else {

   _numCurrentUpload++;

   if (_numCurrentUpload  _aUploadFiles.length) {

 startUpload(false);

   } else {

 lbStatus.text = Upload successful;

 sCloseMode = success

 _timerStatus.start()

   }

   saveProjDoc();

 }

   }//onUploadComplete



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 1:16 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: Return data to FileReference



 Yes, but that file name is the name that was selected by the user, not the
 one that the file was actually renamed to by the servlet.



 On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

 You can get the event.result data in a handler for the uploadCompleteData
 event.



 http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#event:uploadCompleteData



 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 1:01 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Return data to FileReference



 I guess no one else has run into this before?


 On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola [EMAIL PROTECTED] wrote:

 Here is the situation:

 I am uploading files from Flex to a Servlet using the FileReferenceList
 class. Since there is no way to change the filename before it is uploaded, I
 am passing along a parameter which holds the file name I would like the file
 to ultimately be saved as.

 On the server side, all is well. The file is uploaded and then renamed to my
 parameter name.

 So my question is, is there a way to pass the new filename back to Flex so
 that I can access it within the FileReference Event.COMPLETE event listener?

 Rich







 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go

RE: [flexcoders] Re: Return data to FileReference

2008-06-20 Thread Tracy Spratt
Yeah, I should be using DataEvent.UPLOAD_COMPLETE_DATA, but I am not, I
am using Event.COMPLETE, but I am still getting access to the .data
Property and am seeing my XML status returned correctly.

 

As Doug pointed out, this may just be a lucky coincidence.  At any rate,
I think Rich's problem is solved, and I will correct my code to use the
the correct event.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Santiago Gonzales
Sent: Friday, June 20, 2008 7:24 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Return data to FileReference

 

I think he is referring to the two different types of events that you
can listen for on a FileReference. 

1) Event.COMPLETE which does not have a data property (Event Class)

and 

2) DataEvent.UPLOAD_COMPLETE_DATA which does have the property
(DataEvent Class)

Both are in the docs for file reference.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt [EMAIL PROTECTED] wrote:

 Are you saying, complete event is of type flash.events.Event and does
 not have a data property... because of the docs? (which do not list a
 data property)
 
 
 
 Because I am not proposing a theoretical solution, this is operating
 code. I am a bit confused, though about the event datatypes. While I
 am listening for flash.events.Event from Filereference, my listener is
 typing the argument as DataEvent, and no exception is thrown, and I
can
 access the .data property.
 
 
 
 Per the docs, flash.events.DataEvent.UPLOAD_COMPLETE_DATA

http://127.0.0.1:54009/help/nftopic/com.adobe.flexbuilder.help/langref/
http://127.0.0.1:54009/help/nftopic/com.adobe.flexbuilder.help/langref/
 
 flash/events/DataEvent.html#UPLOAD_COMPLETE_DATA  is the correct
event
 to use.
 
 
 
 Tracy
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of Rich Tretola
 Sent: Friday, June 20, 2008 2:41 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: Re: [flexcoders] Re: Return data to FileReference
 
 
 
 OK, the problem with your solution is that the FileReference complete
 event is of type flash.events.Event and does not have a data property
 and the target is the FileReference.
 
 
 
 
 On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:
 
 I just verified it, my handler is working as expected and I can access
 the xml status node I am having the server return.
 
 Tracy
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:58 PM
 
 
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 
 Subject: RE: [flexcoders] Re: Return data to FileReference
 
 
 
 Hmm, looks like I am just using the Event.COMPLETE event. Its been
 awhile since I ran this code, let me double check it.
 
 Tracy
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ]
 On Behalf Of Tracy Spratt
 Sent: Friday, June 20, 2008 1:55 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 
 Subject: RE: [flexcoders] Re: Return data to FileReference
 
 
 
 The event.result should contain whatever your server sends back, just
 like with a normal httpservice request. Below is the code I am using.
 I send back an xml status node, but you could send anything:
 
 Tracy
 
 
 
 // Called on upload complete
 
 private function onUploadComplete(event:DataEvent):void {
 
 var sData:String = event.data;
 
 var xmlStatus:XML = XML(sData);
 
 if ([EMAIL PROTECTED] == error) {
 
 this.height = 200;
 
 lbStatus.setStyle(color,red);
 
 lbStatus.text = Error Uploading File:;
 
 txtError.text = [EMAIL PROTECTED];
 
 sCloseMode = ioerror
 
 //_timerStatus.delay = 6000;
 
 //_timerStatus.start() 
 
 }
 
 else {
 
 _numCurrentUpload++;
 
 if (_numCurrentUpload  _aUploadFiles.length) {
 
 startUpload(false);
 
 } else {
 
 lbStatus.text = Upload successful;
 
 sCloseMode = success
 
 _timerStatus.start()
 
 } 
 
 saveProjDoc(); 
 
 }
 
 }//onUploadComplete
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders