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

Reply via email to