Simple class Rectangle - little error

I have designing a class Rectangle (i have 2 files and Rectangle.fla that I have in the same directory added in classpath in the menu Edit->Preferences->Actionscript tab->Actionscript 2.0 settings and I added the exactly path where I have the 2 files). This is not my problem.

I have here my 2 files: (in the same location as you can see very well)

I added this class path like that (is the first path):

It’s the name of the folder from first picture above but it’s not seeing the entire path. Hope it’s ok until now.

And now to expose my real problem:

My problem is when I try to compile my .fla file I receive an error.

First I list the 2 files ( and Rectangle.fla):

Contents of file

class Rectangle
{ private var mcContainer:MovieClip;

function resize(xscale:Number, yscale:Number):Void
{mcContainer._xscale = xscale;
mcContainer._yscale = yscale;

function Rectangle(x1:Number,y1:Number,x2:Number,y2:Number)
{var d:Number = _root.getNextHighestDepth(); // ca sa nu inlocuim cu un alt
//simbol movieclip
mcContainer = _root.createEmptyMovieClip("container"+d,d);
mcContainer = lineStyle(lineWidth,lineColor);


Contents of Rectangle.fla:

// in fisierul.fla definim obiectele si apelam functiile membru

// e un fel de program principal

// fisierul .as contine clasa cu date membru si functii membru

import mx.*; // import the class defined in mx is the folder that I store first //printscreen where I have the 2 files

private lineWidth:Number = 5; // grosimea liniei cu care trasam forma
private lineColor:Number = 0xFF0000; // culoarea rosie

var obiect_rectangle:Rectangle = new Rectangle(10,10,100,100);

var obiect_rectangle2:Rectangle = new Rectangle(50,50,120,120);

And when I press CTRL+ENTER to run Rectangle.fla which contains instances of my class Rectangle (made in I receive that error:

Attribute used outside class.

And the line that tells me the error is this:

private lineWidth:Number = 5; // from Rectangle.fla file here is the error

Where I made the mistake? Please help me to solve this problem so that I run in good conditions my Rectangle class.

How can I modify the contents of the two files to be all ok?

I struggle for an hour to deal with that and I don’t see the solution.

Thanks for reading my long thread but hope I give all the necessary details in order to help me.

Thanks in advance!


I tried also in my Rectangle file using :

#include “”

But the same error appear.

Pls I really need help all my post have the same error but in other cases!

So pls help me with this thing I’m stuck because I’m lack of ideas.