package {
import flash.display.*;
import flash.events.*;
public class FlashTest extends MovieClip {
public var Level:MovieClip;
public var Hit:Array;
public var Disp:Array;
public function FlashTest() {
Level = new MovieClip();
Hit = new Array(
["linestyle",1,0x000000,1],
["fill",0x00ff00],
["circle",55,75,10],
["fill",0xffff00],
["move",20,80],
["line",40,80],
["curve",42,88,50,90],
["line",20,90],
["line",20,80],
["endfill"],
["fill",0xffff00],
["move",50,40],
["line",50,60],
["curve",42,62,40,70],
["line",40,40],
["line",50,40],
["endfill"],
["fill",0xffff00],
["move",90,60],
["line",60,60],
["curve",68,62,70,70],
["line",90,70],
["line",90,60],
["endfill"],
["fill",0xffff00],
["move",60,110],
["line",60,90],
["curve",68,88,70,80],
["line",70,110],
["line",60,110],
["endfill"],
["fill",0xff0000],
["rect",20,40,15,35],
["rect",55,40,35,15],
["rect",75,75,15,35],
["rect",20,95,35,15],
["endfill"]);
Disp = new Array();
addChild(Level);
stage.addEventListener(Event.ENTER_FRAME,main);
drawLevel();
}
public function main(e:Event):void{
}
public function drawLevel():void{
for(var i:int=0;i<Hit.length;i++){
drawStuff(Hit[i],Level);
}
for(i=0;i<Disp.length;i++){
drawStuff(Hit[i],this);
}
}
public function drawStuff(A:Array,M:MovieClip):void{
with(M.graphics){
switch(A[0]){
case "rect":
drawRect(A[1],A[2],A[3],A[4]);
break;
case "circle":
drawCircle(A[1],A[2],A[3]);
break;
case "move":
moveTo(A[1],A[2]);
break;
case "line":
lineTo(A[1],A[2]);
break;
case "curve":
curveTo(A[1],A[2],A[3],A[4]);
break;
case "fill":
beginFill(A[1]);
break;
case "endfill":
endFill();
break;
case "linestyle":
lineStyle(A[1],A[2],A[3]);
break;
}
}
}
}
}
class ball{
function ball():void{
}
}