conspirisi
01-22-2009, 05:13 PM
Why does this class work even though I haven't imported the graphics class?
package {
import flash.display.MovieClip;
public class Rect extends MovieClip{
private var xPos:Number;
private var yPos:Number;
public function Rect(xPos:Number,yPos:Number) {
graphics.beginFill( 0x0099FF , 1 );
graphics.drawRect( 20 , 20 , 20,20 );
graphics.endFill( );
trace ("Rect falls")
x = xPos;
y = yPos;
}
}
}
package {
import flash.display.MovieClip;
public class Rect extends MovieClip{
private var xPos:Number;
private var yPos:Number;
public function Rect(xPos:Number,yPos:Number) {
graphics.beginFill( 0x0099FF , 1 );
graphics.drawRect( 20 , 20 , 20,20 );
graphics.endFill( );
trace ("Rect falls")
x = xPos;
y = yPos;
}
}
}