I’m having a problem setting some listeners in a class which extends Movie Clip
class ContDisplay extends MovieClip{
//Arrays annd data repository
private var images:Array;
private var path:String;
//Movicelips
private var cont:MovieClip;
//Depths
private var dpth_cont:Number = new Number (18);
private var dpth_nav:Number = new Number (22);
//Dimensions and positions
private var module_w:Number = new Number(561);
private var module_h:Number = new Number(249);
private var module_xoffset:Number = new Number (151);
private var module_yoffset:Number = new Number (24);
//Listner and Loader
private var contlist:Object;
var contloader:MovieClipLoader;
//Counter
private var counter:Number;
//Constructor
function ContDisplay(){
this.contlist = new Object()
contlist.onLoadInit = function (target_mc){
trace ("init")
if (counter >0){
target_mc._alpha = 0
target_mc.alphaTo(100,1, "easeOutQuad")
}
if (counter == images.length -1){
}else{
counter++
loadContent()
}
}
contlist.onLoadStart = function(target:MovieClip){
trace("loadstart")
}
this.contloader = new MovieClipLoader();
this.contloader.addListener(this.contlist);
////////////// MovieClip Setup //////////////
this.images = new Array()
this.counter = 0
}
// Methods
public function init(datasource:Object){
this.images = datasource.imagepath
this.path = datasource.path
//MovieClips
this.cont = this.createEmptyMovieClip ("cont", this.dpth_cont)
this.cont.segs = new Array()
cont._x = module_xoffset
cont._y= mask._y = module_yoffset
this.loadContent()
}
function loadContent(){
//Filling the content
//description
var ref:MovieClip = cont.createEmptyMovieClip("cont"+counter, cont.getNextHighestDepth());
ref.fillMc(this.module_w, this.module_h, _root.bgcolor)
// photo
var ref:MovieClip = cont.createEmptyMovieClip("cont"+counter, cont.getNextHighestDepth());
ref.fillMc(this.module_w, this.module_h, _root.bgcolor)
var photo:MovieClip = ref.createEmptyMovieClip("photo", ref.getNextHighestDepth());
if (this.counter >1){
ref._x = this.cont.segs[counter-1]._x + this.cont.segs[counter-1]._width
}
this.cont.segs.push(ref)
var perc = _root.lang+"/"+this.path+ this.images[this.counter]
contloader.loadClip(perc, ref.photo)
}
}
Basically, when the class is instantiated, the loader and the listener are created and the listener receives all the functions for the Start and Init events.
Then from outside i call the init method passing with it an object with all the data i need and then i call the function loadContent that should load an array of images.
The problem mainly is that when I invoke the MovieclipLoader.loadClip() Method
the linked listener doesn’t work at all
(on the onLoadInit i call back the loadContent function, until the images on the array is totally loaded)
Any suggestion/advice??