;

PDA

Click to See Complete Forum and Search --> : fun with flash drawing


blanius
09-12-2005, 12:16 AM
http://bretlanius.com/flash/drawit.html

Uses drawing coordinates from

http://bretlanius.com/flash/painter2.html

Just a port of something I had done in 3dfa a long time ago. The painter program was done in 3dfa.

Could be used for just the follow path part.

here's the entire code for the drawit movie

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);

vini-v
09-12-2005, 11:49 AM
Thats pretty neat O.