# \[AS 2.0\] 'this' keyword not working inside onLoadInit

**URL:** <https://forum.kirupa.com/t/as-2-0-this-keyword-not-working-inside-onloadinit/204633>\
**Category:** flash\
**Created:** [October 21, 2006, 7:56pm UTC](https://forum.kirupa.com/t/as-2-0-this-keyword-not-working-inside-onloadinit/204633 "2006-10-21T19:56:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [October 21, 2006, 7:56pm UTC](https://forum.kirupa.com/t/as-2-0-this-keyword-not-working-inside-onloadinit/204633/1 "2006-10-21T19:56:14Z")

</div>

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:

```auto
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
