var cont:Sprite = new Sprite(); var g:Graphics = cont.graphics; g.lineStyle(2, Math.random() * 0xFFFFFF); g.lineTo(100, 100); addChild(cont);