# How to get a reference to the main display object?

**URL:** https://forum.kirupa.com/t/how-to-get-a-reference-to-the-main-display-object/315507
**Category:** flash
**Created:** [October 27, 2010, 10:21pm UTC](https://forum.kirupa.com/t/how-to-get-a-reference-to-the-main-display-object/315507 "2010-10-27T22:21:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sdc](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sdc](https://forum.kirupa.com/u/sdc)
#### Post date: [October 27, 2010, 10:21pm UTC](https://forum.kirupa.com/t/how-to-get-a-reference-to-the-main-display-object/315507/1 "2010-10-27T22:21:10Z")

</div>

Hey guys!

Right now I have a library that does something like this:

public class Main extends Sprite{  
public function Main():void {  
MyLibrary.init(this);  
// the rest of your code goes here  
}  
}

I need the user to do that since I need a reference to the current DisplayObject since I need to access loaderInfo.sharedEvents

Is it possible to get a reference to the displayobject or to the loaderInfo of the movie currently being played (maybe it’s a static var of some class?)?

I was thinking on something like. flash.system.ApplicationDomain.currentDomain is there something like… flash.display.DisplayObject.\_root?

In AS2 this would be trivial but I’m afraid this may not be possible in AS3 :(… and I really need to get rid of that “init” call.

Any ideas?
