Flash & Swish  Home Flash & Swish Swish Tutorials Drawing With Swishmax
rss

Drawing With Swishmax

Author: Craig Lowe 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.




Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Drawing With Swishmax"