I am seeing cases when the image loader COMPLETE event will not fire. Does anyone know why this is the case? I wonder if there is something wrong with some of my images that causes a bug in FLEX.
Here is an example: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()"> <mx:Script> <![CDATA[ private function init():void { myImage.addEventListener(ProgressEvent.PROGRESS, progressEventHandler); myImage.addEventListener(Event.COMPLETE, completeEventHandler); myImage.addEventListener(Event.UNLOAD, unloadEventHandler); reload(); } private function reload():void { // myImage.load("http://www.google.com/intl/en_ALL/images/logo.gif"); myImage.load("http://www.mangumfamily.org/bar.jpg"); } private function progressEventHandler(evt:ProgressEvent):void { trace("PROGRESS: bytesLoaded="+evt.bytesLoaded+", bytesTotal="+evt.bytesTotal); } private function completeEventHandler(evt:Event):void { trace("COMPLETE"); } private function unloadEventHandler(evt:Event):void { trace("UNLOAD"); } ]]> </mx:Script> <mx:Image id="myImage"/> <mx:Button label="Reload Image" y="308" click="reload()"/> </mx:Application> Notice that COMPLETE never gets called. If you copy the URL into a web browser it loads fine. If you change the url in the code to the Google one, it loads fine. What is wrong with my image? Maybe I need to log a bug to FLEX. Thanks for your help! Gary