1119: Access of possibly undefined property parent through a reference with static ty

Hi,

I’m having bit of a headache with 1119 error and I can’t figure out why.
The problematic line is in red.

What I’m trying to do is:

  1. Add Display Object “imagesGallery” to mainWin
  2. Add MovieClip “imagesPreloader” to “imagesGallery”
  3. Fire the “load” function from “imagesListLoader” which should fireup the function imagesLoaded in “imagesGallery”

Here’s the code:

mystage/MainWin.as:

package mystage {
 
 import flash.display.MovieClip;
 import flash.events.Event;
 
 import gallery.*;                                 // Importing all the classes below
 
 public class MainWin extends MovieClip {
  private var imagesGallery = new ImagesGallery;

  public function MainWin() {
   addEventListener(Event.ADDED_TO_STAGE, Init);   
  }
  
  private function Init(e:Event):void {
   removeEventListener(Event.ADDED_TO_STAGE, Init);
   addChild(imagesGallery);
  }
 }
}

gallery/ImagesGallery.as

package gallery {
 
 import flash.display.MovieClip;
 import flash.events.Event;
 
 public class ImagesGallery extends MovieClip {
  
  private var imagesPreloader:ImagesPreloader = new ImagesPreloader;
  private var imagesListLoader:ImagesListLoader = new ImagesListLoader;
  
  public function ImagesGallery():void {
   addEventListener(Event.ADDED_TO_STAGE, init);
  }
  
  private function init(e:Event):void {
   removeEventListener(Event.ADDED_TO_STAGE, init);
   addChild(imagesPreloader);
   imagesListLoader.load();
  }
  
  public function imagesLoaded():void {
   trace("Images List Loaded");
  }
 }
}

***gallery/ImagesPreloader ***


package gallery {
 
 import flash.display.MovieClip;
 import flash.events.Event;
 
 public class ImagesPreloader extends MovieClip {
  
  public function ImagesPreloader():void {
   addEventListener(Event.ADDED_TO_STAGE, init);
  }
  
  private function init(e:Event):void {
   removeEventListener(Event.ADDED_TO_STAGE, init);
   trace("Preloader Initiated");
  }
 }
}

gallery/ImagesListLoader

package gallery {
 
 import flash.display.MovieClip;
 
 public class ImagesListLoader {
 
  public function ImagesListLoader():void {
    trace("ImagesList Loader Inititated");
   }
  
  public function load():void {
    trace("Images List Loading");
  [COLOR=#ff0000] MovieClip(this.parent).imagesLoaded();
[/COLOR]   }
  }
}

What am I doing wrong?

Thanks