Greetings and thanks for any assist (Especially Bret - I'm standing on your coded shoulders),

I am in over my head in my attempts to master AS. As such, I am constantly piecing together bits of code to learn and accomplish my immediate tasks. Following is a chunk of code that Bret posted several years ago to graphically draw point-by-point any color line (cool! I simplified the coordinate set to draw a rectangle and a triangle. While this was not written with KoolMoves in mind, it works fine.

What I wish to accomplish is to ad a bit of code to trace a "pencil" bmp/jpeg element around the screen so that the appearance is that the "pencil" draws the line as it is being scripted. The best I can do is display a pencil element that just sits there. I do not yet have the grasp of embedding the graphic into the script to make it move.

I am totally open to being directed to an example that demonstrates that which I wish to achieve, and I apologize if this is a redundant request. I simply can not locate the answer on my own. If someone would be so kind as to throw me a coded bone . . .

Namaste - FlashPast (Baran)








function drawit(coords){

if (idx<coords.length){//Not the end of the Array?

if (coords[idx]>=1000){//it's a moveTo
trace("MOVE");
//Move it
canvas.moveTo(coords[idx]/1000,coords[idx+1]/1000)

}//End if Move

if (coords[idx]==-1){//it's a Change Color
trace("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
// trace("line");
//draw the line to the coordinates
canvas.lineTo(coords[idx],coords[idx+1]);
} //end If lineTo


}//end if
idx=idx+2;


}//end function

var idx=0;
var coords = new Array();

coords[0]=150000
coords[1]=200000
coords[2]=150
coords[3]=200
coords[4]=350
coords[5]=200
coords[6]=350
coords[7]=500
coords[8]=150
coords[9]=500
coords[10]=150
coords[11]=200
coords[12]=550000
coords[13]=250000
coords[14]=-1
coords[15]=50000
coords[16]=550
coords[17]=250
coords[18]=650
coords[19]=350
coords[20]=450
coords[21]=350
coords[22]=550
coords[23]=250

_root.createEmptyMovieClip ("canvas", 1);
canvas.lineStyle(3,0,100);
stop();
mytimer=setInterval(drawit,250,coords);