# ActionScript 3.0 stage access from within component class code

**URL:** <https://forum.kirupa.com/t/actionscript-3-0-stage-access-from-within-component-class-code/300722>\
**Category:** flash\
**Created:** [November 26, 2009, 3:44am UTC](https://forum.kirupa.com/t/actionscript-3-0-stage-access-from-within-component-class-code/300722 "2009-11-26T03:44:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iblis\_raeb](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iblis\_raeb](https://forum.kirupa.com/u/iblis_raeb)\
**Post date:** [November 26, 2009, 3:44am UTC](https://forum.kirupa.com/t/actionscript-3-0-stage-access-from-within-component-class-code/300722/1 "2009-11-26T03:44:53Z")

</div>

Please help me work out how to access the stage from within component code. (I am very new to ActionScript)

Here is the cut down code of the main application entry point:

```auto

package {
	import flash.display.Sprite;
	
	public class Main extends Sprite {
		
		private var _textarea:TextArea;
		
		public function Main():void {			
			_textarea = new TextArea();

			this.addChild(_textarea);

			_textarea.show();
		}
	}
}

```

Here is the cut down code of the textarea component:

```auto

package {
	import flash.display.Sprite;

	public class TextArea extends Sprite {
		
		public function TextArea():void {
			trace(this.root); // is null
			trace(this.parent); // is null
			trace(this.stage); // is null
		}

		public function show():void {
			this.visible = true;			
		}
	}	
}

```

I need to access the main stage to add a mouse up event listener.

Thank you.
