# Starting with Classes

**URL:** <https://forum.kirupa.com/t/starting-with-classes/282285>\
**Category:** flash\
**Created:** [February 19, 2009, 8:39pm UTC](https://forum.kirupa.com/t/starting-with-classes/282285 "2009-02-19T20:39:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deluka](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@Deluka](https://forum.kirupa.com/u/Deluka)\
**Post date:** [February 19, 2009, 8:39pm UTC](https://forum.kirupa.com/t/starting-with-classes/282285/1 "2009-02-19T20:39:16Z")

</div>

Hello there  
I’m just starting with this powerfull option in flash  
What I’m trying to do is writing a simple class thats buts some text on the stage.  
the next script those not give any errors but can’t see anything on stage

```auto
package classlibrary{
	import flash.display.*;
	import flash.text.*;

	public class MenuBuilder extends Sprite {
		private var display_txt:TextField;
		public function MenuBuilder (myVar) {

			// check if the function is called
			trace ('public function MenuBuilder');

			//Check the content of MyVar
			trace (myVar);

			display_txt = new TextField();
			display_txt.width = 250;
			display_txt.x = 100;
			display_txt.y = 100;

			display_txt.text = myVar;
			addChild (display_txt);

			
		}
	}
}

```

The code in my fla

```auto
import classlibrary.MenuBuilder;
var myvar:String = "A Variable"
var testClass:MenuBuilder = new MenuBuilder(myvar);

```
