labs.insert-title.com

Scribbles

Overview

Using the drawing API in the Flash Player we have a simple bit of script that generates lines in random directions, or random color and thickness and occasionally a curve as well.

A usual the actionscript I implement in this script will not play in the internaly Swishmax player, as it is built on the Flash Player 4. The latest Flash Player 5+ should play this without any of the actionscript issues you will see in the internal Swishmax player.

The Flash

The Script


function makeHolder() {
    nColor=Math.round(Math.random()*0xFFFFFF);
    x=0;
    holder.clear();
    _root.createEmptyMovieClip("holder",0);
    MaxLines=Random(30)+1;
    nSize=Random(10);
    holder.moveTo(a,d);
}
onFrame (1) {
    if (x>MaxLines) {
	makeHolder();
    }
}
onFrame (2) {
    x++;
    a=Random(300)+1;
    b=Random(300)+1;
    c=Random(300)+1;
    d=Random(300)+1;
    holder.lineStyle(nSize,nColor,100);
    if (x==Random(10)+1) {
	holder.lineTo(c,b);
    }
    holder.curveTo(a,b,c,d);
    prevFrameAndPlay();
}

The Download

Download swish file





Discussion

julienne*drop

Neat and thanks

New comments are currently disabled, you can find me @joemaddalone Comments temporarily disabled for now, you can find me @joemaddalone