A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: fun with flash drawing

  1. #1
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    fun with flash drawing

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

    Last edited by blanius; 09-12-2005 at 11:41 AM.

  2. #2
    Member
    Join Date
    Jun 2004
    Posts
    64
    Thats pretty neat O.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center