I am trying to switch from the old graphics API methods to new ones, but It seems not enugh tested/polished…
graphics.beginFill(0x33FF11);
graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
graphics.lineStyle(2);
graphics.beginFill(0xFFFFFF);
graphics.moveTo(100,100);
graphics.lineTo(200,100);
graphics.lineTo(200,200);
graphics.lineTo(100,200);
graphics.lineTo(100,100);
graphics.lineStyle();
graphics.moveTo(125,125);
graphics.lineTo(175,125);
graphics.lineTo(175,175);
graphics.lineTo(125,175);
graphics.endFill();
var vector:Vector.<IGraphicsData> = new Vector.<IGraphicsData>(6, true);
vector[0] = new GraphicsStroke(2, true, LineScaleMode.NONE, CapsStyle.NONE, JointStyle.MITER, 3.0, new GraphicsSolidFill(0,1));
vector[1] = new GraphicsSolidFill(0xFFFFFF);
var extData:Vector.<Number> = new Vector.<Number>(10, true);
extData[0] = 100 + 150
extData[1] = 100
extData[2] = 200 + 150
extData[3] = 100
extData[4] = 200 + 150
extData[5] = 200
extData[6] = 100 + 150
extData[7] = 200
extData[8] = 100 + 150
extData[9] = 100
vector[2] = new GraphicsPath(Vector.<int>([1,2,2,2,2]), extData);
vector[3] = new GraphicsStroke();
var intData:Vector.<Number> = new Vector.<Number>(8, true);
intData[0] = 125 + 150
intData[1] = 125
intData[2] = 175 + 150
intData[3] = 125
intData[4] = 175 + 150
intData[5] = 175
intData[6] = 125 + 150
intData[7] = 175
vector[4] = new GraphicsPath(Vector.<int>([1,2,2,2]), intData);
vector[5] = new GraphicsEndFill();
graphics.drawGraphicsData(vector)
The code creates 2 squares with empty inside (frames), the first one is the goal, the second is created using new methods and I have no clue how to finish the transition, any thoughts?