# My first class file..........Need Help

**URL:** <https://forum.kirupa.com/t/my-first-class-file-need-help/201201>\
**Category:** flash\
**Created:** [September 19, 2006, 11:31am UTC](https://forum.kirupa.com/t/my-first-class-file-need-help/201201 "2006-09-19T11:31:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavanshinde](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pavanshinde](https://forum.kirupa.com/u/pavanshinde)\
**Post date:** [September 19, 2006, 11:31am UTC](https://forum.kirupa.com/t/my-first-class-file-need-help/201201/1 "2006-09-19T11:31:25Z")

</div>

Hi,

I am learning how to create class files in flash. With the help of some tutorial i have created my first class file which is attached.

I am trying to create a rectangle with the class file here is the code also.

[COLOR=DarkRed]class hotSpotClass extends MovieClip  
{  
function hotSpotClass(logoToLoad:String)  
{  
var myName:String;  
var hotSpotX1:Number;  
var hotSpotY1:Number;  
var hotSpotX2:Number;  
var hotSpotY2:Number;  
}  
function addHotSpot(x1, y1, x2, y2, AnchoLin, ColorLin, AlfaLin, ColorFill, AlfaFill)  
{  
trace(“Inside add hot spot”);  
trace("x1 is : " + x1 + " " + ColorFill);  
this.createEmptyMovieClip(“newHotSpot”, this.getNextHighestDepth());

```
    this.lineStyle(AnchoLin, ColorLin, AlfaLin);
    this.beginFill(ColorFill, AlfaFill);
    this.moveTo(x1, y1);
    this.lineTo(x2, y1);
    this.lineTo(x2, y2);
    this.lineTo(x1, y2);
    this.lineTo(x1, y1);
    this.endFill();
    //trace(newHotSpot._x);
}
function sample(myName:String)
{
    trace("this is testing from " + myName);
}

```

}[/COLOR]

i am accessing all the methods working fine but the rectangle was not created. Plz can any one help me on this.

i have wrtien this code in my FLA file.

import hotSpotClass;  
var testObj:Object = new hotSpotClass()  
testObj.addHotSpot(5,15,45,0,1,0xffcc00,100,0x999999,15)

Thanks and regards
