# Question about stage.addchild from within a class

**URL:** https://forum.kirupa.com/t/question-about-stage-addchild-from-within-a-class/328273
**Category:** Uncategorized
**Created:** [May 2, 2012, 9:00pm UTC](https://forum.kirupa.com/t/question-about-stage-addchild-from-within-a-class/328273 "2012-05-02T21:00:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Matery](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Matery](https://forum.kirupa.com/u/Matery)
#### Post date: [May 2, 2012, 9:00pm UTC](https://forum.kirupa.com/t/question-about-stage-addchild-from-within-a-class/328273/1 "2012-05-02T21:00:59Z")

</div>

Hi, i’m trying to teach me some flash i’ve done some .net programming mostly data Analysis and control program for lab equipment, well now to the point.

I’m trying to make a little strategy game. And i’ve made a class that displays a menu when you click on a city it also controls what’s shown in that menu basically display data that’s in the “city” class. I haven’t used classes before for anything except storing data so i had problems adding the menu to the stage but fixed it by adding everything that was null as an argument.

```auto
public function build_menu(e:MouseEvent,info_format:TextFormat,c_menu:MovieClip,STAGE:Stage):void {here is code} 

```

It’s works now but i’m wondering if there are better ways to do this.  
I tried parent.stage but that didn’t work.  
Thnx in advance.
