Class Variables

I have created a new class called Line that extends the MovieClip class in a external .as file.

The class Line has a variable in it called XVal. (i used var XVal:Number; to declare)

I then created an instance of this using the line:
attachMovie(“Line”, ‘line1’, 100);

If i want to access the value of XVal from the instance line1 on the main timeline what syntax do i use?

cheers!

Dave

you need to know that attachMovie returns a reference to a movieclip… so you can simply do…


var line1 = attachMovie("Line", "line1", 100);

trace( line1.XVal );

Take Care
_Michael

thanks man =)

no worries