code:
mc1.swapdepths(99999);//mc1 is the pencil
function drawit(coords){
if (idx<coords.length){//Not the end of the Array?
if (coords[idx]>=1000){//it's a moveTo
//Move it
canvas.moveTo(coords[idx]/1000,coords[idx+1]/1000)
mc1._x=coords[idx];
mc1._y=coords[idx+1];
}//End if Move
if (coords[idx]==-1){//it's a Change Color
canvas.lineStyle (3,coords[idx+1],100)//assume line width of 1 and Alpha of 100
}//end if Change Color
if (coords[idx]>-1 && coords[idx]<1000){//It's a lineTo
//draw the line to the coordinates
canvas.lineTo(coords[idx],coords[idx+1]);
mc1._x=coords[idx];
mc1._y=coords[idx+1];
} //end If lineTo
}//end if
else{
mc1._alpha=0;
}
idx=idx+2;
}//end function
var idx=0;
var coords = new Array();
/*Coords go here from painter program
*/
_root.createEmptyMovieClip ("canvas", 1);
canvas.lineStyle(3,0,100);
stop();
mytimer=setInterval(drawit,50,coords);