# Simple Class - How can I point it to the Main Timeline?

**URL:** https://forum.kirupa.com/t/simple-class-how-can-i-point-it-to-the-main-timeline/286992
**Category:** flash
**Created:** [April 24, 2009, 5:55am UTC](https://forum.kirupa.com/t/simple-class-how-can-i-point-it-to-the-main-timeline/286992 "2009-04-24T05:55:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Nineteen](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nineteen/32/2679_2.png) [@Nineteen](https://forum.kirupa.com/u/Nineteen)
#### Post date: [April 24, 2009, 5:55am UTC](https://forum.kirupa.com/t/simple-class-how-can-i-point-it-to-the-main-timeline/286992/1 "2009-04-24T05:55:03Z")

</div>

Hi,

In the Main Timeline I have

```auto

import FlashVar;

// Instantiate FlashVar Class and Pass Root.
var myFlashVar:FlashVar = new FlashVar(this);

trace(myFlashVar.getVar('myFlashVar'));

```

Which uses the Class

```auto

package {
	import flash.display.MovieClip;
	import flash.display.LoaderInfo;

	public class FlashVar {
		// Param Object.
		private var paramObj:Object;
		// Constructor.
		public function FlashVar(DocRoot:MovieClip):void {
			// Set Relative to Root DocRoot.
			paramObj = LoaderInfo(DocRoot.root.loaderInfo).parameters;
		}
		// Get FlashVar.
		public function getVar(objVar:Object) {
			return paramObj[objVar];
		}
	}
}

```

Now I have to pass ‘this’ when instantiating the class so that later I can use DocRoot to get the loaderInfo for FlashVars.

Is there any way to not have to pass ‘this’ and have the external class point to the Main Timeline?

Cheers,  
Ryan
