# Check if added to stage

**URL:** <https://forum.kirupa.com/t/check-if-added-to-stage/316518>\
**Category:** Uncategorized\
**Created:** [November 24, 2010, 7:44am UTC](https://forum.kirupa.com/t/check-if-added-to-stage/316518 "2010-11-24T07:44:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasxa](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sasxa](https://forum.kirupa.com/u/sasxa)\
**Post date:** [November 24, 2010, 7:44am UTC](https://forum.kirupa.com/t/check-if-added-to-stage/316518/1 "2010-11-24T07:44:43Z")

</div>

Is there a way to check if parent object is added to stage inside a class, before child is added to stage. Something like this:

```php

public class Main extends MovieClip {
   public function Main() {
      var test:MyClass = new MyClass();
      addChild(test);
   }
}
public class MyClass extends Sprite {
   public function MyClass() {
      var test:MyOtherClass = new MyOtherClass();
      // need to set some properties of test instance
      // based on weather MyClass is added to stage or not
 
      addChild(test);
      // here it would be: if (test.parent.stage != null);
   }
}
public class MyOtherClass extends Sprite {
   public function MyOtherClass() {
      // check if MyClass is added to stage ??
   }
}

```
