Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player



/*
Pollock
|ˈpälək| |ˈpɑlək| |ˈpɒlək|
Pollock, (Paul) Jackson (1912–56), U.S. painter.

A leading figure in the abstract expressionist movement, he became the chief exponent of the style known as action painting from 1947.
Fixing the canvas to the floor or wall, he poured, splashed, or dripped paint on it, covering the whole canvas and avoiding any point of emphasis.
*/

//-----------------

var color:Number;
color=0x000000;

stage.addEventListener(MouseEvent.CLICK,turnOn);
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawLine);

/*
Our Event Listener will have to be specified by declaring the function the same way any other function is declared in ActionScript,
the only difference is that the listener function must have one argument to represent the event.
This event argument can have any identifier as its name, I use the letter 'e' for it as shown in the code below:
*/

function turnOn(e:MouseEvent) {
if (color==0xffffff) {
color = Math.random()*500000000; //#of colors
} else {
color=0xffffff;
}
}
function drawLine(e:MouseEvent) {
var r:Number;

graphics.lineStyle(2, color, 1.0);
r = Math.random()*50.0; //radius of the circle
graphics.drawCircle(e.stageX, e.stageY, r);
}