Hello, I'm currently working on a few small paint programs designed to emulate certain famous painters. I'm using a pretty basic AS2 painting program and simply manipulating it to my needs, but have run into a few problems that trial and error have not been able to fix.

For two of the programs I would like the up and down arrows of the keyboard to change the size of the brush, which is currently set by the variable ranWidth (one of the other programs uses random widths for the brush).

For one of the programs, the left and right arrows will increase or decrease the paint opacity.

One of the programs will be a pointillism style drawing program, so instead of drawing a line as it does currently, I'm trying to have it draw a series of dots, without having to click down every time.

Third, my color selection right now changes randomly each time the user clicks down. This works fine for some of the programs, but others it really is neccesary to choose a color. I've tried creating buttons with on release functions that would change the color variable but havn't got them to work properly.

I know its a bit of a list but I think most of the coding is fairly simple, I'm just new to actionscript and trying to learn the ropes. I've used keys to change items before but am not having any luck. Any help for one or all of the items would be greatly appreciated.

Here is my basic script for one of the painting programs. This one simply draws lines in different colors at random sizes.

Actionscript Code:
painting = createEmptyMovieClip('painting',1);

theBrush = new Object ();
theBrush.onMouseDown = function() {
    isPainting = true;
    painting.moveTo(_xmouse,_ymouse);
    painting.lineTo(_xmouse+1,_ymouse+1);
    color = Math.round( Math.random()*0xFFFFFF );
}

theBrush.onMouseMove = function(){
    if(isPainting){
        painting.lineTo(_xmouse,_ymouse);
    }
}

theBrush.onMouseUp = function(){
    isPainting = false;
}
Mouse.addListener(theBrush);

painting.onEnterFrame = function(){
    ranWidth = Math.round((Math.random() * 25)+5);
    painting.lineStyle(ranWidth,color,100);
}