2 Replies Latest reply on Jan 11, 2011 3:24 AM by flexillu10

    Can i change this download func to use http service?

    flexillu10 Level 1

      This a download function i have:


           //Downloads a file and calls the writeFile func
                private function downloadFile(url:String):void{
                     var urlStream:URLStream = new URLStream();
                     var request:URLRequest = new URLRequest(url);
                     //var downloadFileName:String=getDownloadFilename(url);
                     urlStream.addEventListener(Event.COMPLETE, writeFile);
                     urlStream.addEventListener(IOErrorEvent.IO_ERROR , function (e:IOErrorEvent):void{
                     urlStream.addEventListener(IOErrorEvent.IO_ERROR, onIOError);


      I need to change the URL request to send a user/name password in the header for authentication...i can do this with a httpservice...but not a url request


      Can someone change the above code to use a http serivce? instead of a URLrequest/stream? Not sure how to do it