1 Reply Latest reply on Oct 28, 2009 9:42 AM by wilrevehl007

    Event.COMPLETE not working in Flex Image control

    wilrevehl007

      I'm trying to simply add an event listener for when an Image is loaded and it doesn't seem to work in Flex.

       

      public function addThumbnail(thURL:String):void{
                      i = new Image();
                      i.source = thURL;
                      i.addEventListener(Event.COMPLETE, prepNewImage);

                     this.addChild(i);
              }

      private function prepNewImage(evt:Event):void
              {
                  trace("loaded!");

      }

       

      This is beyond me why this wouldn't work.  The docs state that the Image control in Flex inherits SWFLoader's Event.COMPLETE so the event should be dispatched.  I know the file paths are good because the images display when published.  Any idea?!  Thanks so much!!