I’m tyring to do some OOP coding but have trouble figuring out how to keep it all nice and clean. Observe the following class I’ve made:
class Link {
public var identifier:Number;
var xpos:Number;
var ypos:Number;
var nummer:String;
var omschrijving:String;
var image:String;
var loadLinkListener:Object;
var mcLoader:MovieClipLoader;
function Link(id:Number, x:Number, y:Number, n:String, o:String, i:String){
this.identifier = id;
this.xpos = x;
this.ypos = y;
this.nummer = n;
this.omschrijving = o;
this.image = i;
_global.respectMovie.mc_grid.createEmptyMovieClip("link" + identifier, _global.respectMovie.mc_grid.getNextHighestDepth());
this.loadLinkListener = new Object();
this.mcLoader = new MovieClipLoader();
this.mcLoader.addListener(loadLinkListener);
this.mcLoader.loadClip("link.swf", _global.respectMovie.mc_grid["link" + identifier]);
this.loadLinkListener.onLoadInit = function(linkMC:MovieClip):Void{
**trace(this);**
linkMC._x = [COLOR=darkred]this.xpos[/COLOR];
linkMC._y = [COLOR=darkred]this.ypos[/COLOR];
linkMC.nummer = [COLOR=darkred]this.nummer[/COLOR];
linkMC.omschrijving = [COLOR=darkred]this.omschrijving[/COLOR];
linkMC.mc_image.loadMovie([COLOR=darkred]this.image[/COLOR]);
}
}
// more class definition...
}
The problem is that I can’t access my class properties inside the onLoadInit event function. What is the good OOP way to access these properties?
Thanks in advance