# Beginner Class

**URL:** <https://forum.kirupa.com/t/beginner-class/149391>\
**Category:** flash\
**Created:** [May 28, 2005, 4:40pm UTC](https://forum.kirupa.com/t/beginner-class/149391 "2005-05-28T16:40:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![inadaze](https://avatars.discourse-cdn.com/v4/letter/i/8e7dd6/32.png) [@inadaze](https://forum.kirupa.com/u/inadaze)\
**Post date:** [May 28, 2005, 4:40pm UTC](https://forum.kirupa.com/t/beginner-class/149391/1 "2005-05-28T16:40:37Z")

</div>

Hi,  
I’m trying to wrap my head around writing .as files in MX 2004. As a practice file I made a MovieClip called SquareClip in the library of flash file. I made the linkage name SquareClip. My .as file called Square looks like this:

```auto

class Square extends MovieClip{
	
	//Variables
	
	
	//constructor
	function Square(xPos:Number,yPos:Number){
		_x = xPos;
		_y = yPos;
		drawSquare();

	}
	
	//methods
	function drawSquare(){
		attachMovie("SquareClip","mySquare",_root.getNextHighestDepth());
	}
}

```

In the first frame of my flash timeline I wrote:

```auto

var square1:Square = new Square(0,0);

```

Could anyone tell my where my logic is wrong 'cause it doesn’t work.

Thanks  
Jay
