Cheers Jimbo, i downloaded this file to see what i was missing from mine, added the listenor Glen was taling about and alls well! :o) ----- Original Message ----- From: Jimbo To: [email protected] Sent: Tuesday, May 20, 2008 1:02 PM Subject: Re: [Flashcoders] AS3 - Upload image problem
Here's one if you don't want to roll your own- it's really easy to customize: http://www.flepstudio.org/english/utilities/free-utilities/flash-cs3-uploader-_-free-utility-2007073189.html jimbo *********** REPLY SEPARATOR *********** On 5/20/2008 at 12:44 PM SJM - Flash wrote: Glen is that not for AS2? ----- Original Message ----- From: Glen Pike To: Flash Coders List Sent: Tuesday, May 20, 2008 12:30 PM Subject: Re: [Flashcoders] AS3 - Upload image problem http://www.tink.ws/blog/a-round-trip-with-filereference/ SJM - Flash wrote: > Hi guys im having problems with uploading an image, i cant seam to get it to work! Most of the code is from the help files but still no joy! Any ideas... > > public function uploadImage( ev:MouseEvent ):void > { > uploadURL = new URLRequest(); > uploadURL.url = _mainClass._imgUploadURL; > file = new FileReference(); > file.browse(getTypes()); > trace("uploadImage: " + ev); > } > > > The above trace outouts this... > > uploadImage: [MouseEvent type="click" bubbles=true cancelable=false eventPhase=3 localX=16 localY=4 stageX=95.65 stageY=236.70000000000002 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0]] > > As far as i can tell it does not go any further into the code below! > > private function getTypes():Array { > var allTypes:Array = new Array(getImageTypeFilter()); > return allTypes; > } > > > private function getImageTypeFilter():FileFilter { > return new FileFilter("Images (*.jpg, *.jpeg)", "*.jpg;*.jpeg;"); > } > > > private function cancelHandler(ev:Event):void { > trace("cancelHandler: " + ev); > } > > private function completeHandler(ev:Event):void { > trace("completeHandler: " + ev); > } > > private function uploadCompleteDataHandler(ev:Event):void { > trace("uploadCompleteData: " + ev); > _xmlClass.xmlLoader("bannerInfo.xml"); > _xmlClass.addEventListener(Event.COMPLETE, _mainClass.afterUploadXML); > } > > private function httpStatusHandler(ev:HTTPStatusEvent):void { > trace("httpStatusHandler: " + ev); > } > > private function ioErrorHandler(ev:IOErrorEvent):void { > trace("ioErrorHandler: " + ev); > } > > private function openHandler(ev:Event):void { > trace("openHandler: " + ev); > } > > private function progressHandler(ev:ProgressEvent):void { > var file:FileReference = FileReference(ev.target); > trace("progressHandler name=" + file.name + " bytesLoaded=" + ev.bytesLoaded + " bytesTotal=" + ev.bytesTotal); > } > > private function selectHandler(event:Event):void { > var file:FileReference = FileReference(event.target); > trace("selectHandler: name=" + file.name + " URL=" + uploadURL.url); > file.upload(uploadURL); > } > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > -- Glen Pike 01326 218440 www.glenpike.co.uk <http://www.glenpike.co.uk> _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders d _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

