How come drawing this line at (0,0) doesn't really draw it at (0,0)?
- by George Edison
I have this ActionScript code here:
package
{
import flash.display.Sprite;
import flash.display.LineScaleMode;
import flash.display.CapsStyle;
import flash.display.JointStyle;
import flash.display.Shape;
import flash.events.Event;
public class Main extends Sprite
{
private var lines:Shape;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
lines = new Shape();
addChild(lines);
lines.graphics.clear();
lines.graphics.lineStyle(10, 0x000000);
lines.graphics.moveTo(0, 0);
lines.graphics.lineTo(stage.stageWidth, stage.stageHeight);
}
}
}
What I'm expecting this to do is to draw a line from one corner of the screen to the other... but that's not what it does. See here.