Update: Once and for all, how can I draw a line that goes from (0,0) to the opposite corner of the stage?
Here is what I have:
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);
}
}
}
See here for an example of what happens with the file. It's embedded in an HTML page.