Her

Home Flash & Swish Swish Tutorials Drawing With Swishmax

Drawing With Swishmax

Author: Craig Lowe Author's URL: www.swish-designs.co.uk More by this author

Example: Drawing With Swishmax

Click on the above example and start to draw.

Open swishmax and add the following code to Scene_1.

onLoad () {
_root.lineStyle(0, 0x000000, 100);
}
on (press) {
draw = true;
startX = _root._xmouse;
startY = _root._ymouse;
_root.moveTo(startX,startY);
}
on (release) {
draw = false;
}
onEnterFrame(includingFirstFrame) {
if (draw) {
newX = _root._xmouse;
newY = _root._ymouse;
if ((newX != startX) or (newY != startY)) {
_root.lineTo(newX,newY);
startX = newX;
startY = newY;
}
}
}

Thats it, press Ctrl+T and draw away.

Take a look here to see what is capable from this script.