[flexcoders] Re: Can Flex allow image downloads?

2009-01-16 Thread oneworld95
Has anyone done anything like this? I'm looking for examples. Thanks.

-Alex

--- In flexcoders@yahoogroups.com, Dnk d.k.emailli...@... wrote:

 You would have to put it together with flex's download related  
 classes, and add a menu item to the right click menu.
 
 Dnk
 
 On 16-Jan-09, at 7:19 AM, oneworld95 oneworl...@... wrote:
 
  Hi. Is it possible to enable users to right-click on an image in Flex
  and download it? If not, is there another way to allow file downloads?
  Thanks.
 
 





RE: [flexcoders] Re: Can Flex allow image downloads?

2009-01-16 Thread Kenneth Sutherland
Check out the FileReference at
http://livedocs.adobe.com/flex/3/langref/index.html 

 

Brief overview below.

 

_fileRef : FileReference;

//set a filename

_filename : String = 'jptest.jpg';

 

//set a URL

var urlReq:URLRequest = new URLRequest();

urlReq.url = whatever your URL is + _filename;//

//set up a bunch of handlers for progress, errors etc, then

setUpHandlers(_fileRef);

_fileRef.download(urlReq, _filename);

 

 

Do the above first when the user clicks a button or similar (just to
keep it simple) then implement it into a right click menu.  If I
remember correctly when I was testing downloads, even though I hard
coded the URL while testing, if I ran it locally it never worked. Deploy
it and test it from there.

 

HTH Kenneth.

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of oneworld95
Sent: 16 January 2009 15:55
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Can Flex allow image downloads?

 

Has anyone done anything like this? I'm looking for examples. Thanks.

-Alex

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Dnk d.k.emailli...@... wrote:

 You would have to put it together with flex's download related 
 classes, and add a menu item to the right click menu.
 
 Dnk
 
 On 16-Jan-09, at 7:19 AM, oneworld95 oneworl...@... wrote:
 
  Hi. Is it possible to enable users to right-click on an image in
Flex
  and download it? If not, is there another way to allow file
downloads?
  Thanks.
 
 


 

Disclaimer 
---
This electronic message contains information which may be privileged and 
confidential. The information is intended to be for the use of the 
individual(s) or entity named above. If you are not the intended recipient, be 
aware that any disclosure, copying, distribution or use of the contents of this 
information is prohibited. If you have received this electronic message in 
error, please notify us by telephone on 0131 476 6000 and delete the material 
from your computer. 
Registered in Scotland number: SC 172507. 
Registered office address: Quay House 142 Commercial Street Edinburgh EH6 6LB. 

This email message has been scanned for viruses by Mimecast.
---