# Drawing in Class definition

**URL:** <https://forum.kirupa.com/t/drawing-in-class-definition/269237>\
**Category:** flash\
**Created:** [August 25, 2008, 6:53am UTC](https://forum.kirupa.com/t/drawing-in-class-definition/269237 "2008-08-25T06:53:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![playing\_life](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@playing\_life](https://forum.kirupa.com/u/playing_life)\
**Post date:** [August 25, 2008, 6:53am UTC](https://forum.kirupa.com/t/drawing-in-class-definition/269237/1 "2008-08-25T06:53:36Z")

</div>

Hi everybody,  
I am sorry if this is a stupid question but I have searched for the last 3 days and I did not find an answer to this.

I want to create a class which extends a MovieClip class and I am trying to have in te constructor of the class to draw some graphic. Is this even possible of is there something I do wrong? I get no error but I can’t see anything on the screen.

## Code in Flash:

## var tabel = new data\_matrix();

## Code in text editor - where I buid the class:

class data\_matrix extends MovieClip{

```
public var dshape:MovieClip;

```

## function data\_matrix(){ dshape=this.createEmptyMovieClip(“dshape1”,100); dshape.lineStyle(0, 0xFF0000, 100); dshape.lineTo(100, 0); dshape.lineStyle(0, 0x00FF00, 100); dshape.lineTo(100, 100); trace(this.\_name); }

Also the trace command above displays UNDEFINED like the object is not even defined.

I thank you very much in advance.
