Frame 1
function fncInit() {
mcCanvas._x = 0;
mcCanvas._y = 0;
mcCanvas.mcBoard._x = 0;
mcCanvas.mcBoard._y = 0;
mcCanvas.mcBoard._width = Stage.width;
mcCanvas.mcBoard._height = Stage.height;
mcCanvas.varPress = false;
mcCanvas.varDraw = new Array();
mcCanvas.varPoint = 0;
mcCanvas.varLine = 0;
mcCanvas.varRndX = 0;
mcCanvas.varRndY = 0;
}
function fncDrawLine() {
var _local3;
var _local2;
var _local7;
var _local5;
var _local6;
var _local4;
mcCanvas.clear();
mcCanvas.lineStyle(_global.gStyle.weight, _global.gStyle.color, _global.gStyle.alpha);
_local3 = 0;
while (_local3 < mcCanvas.varDraw.length) {
_local2 = 1;
while (_local2 < mcCanvas.varDraw[_local3].length) {
_local7 = mcCanvas.varDraw[_local3][_local2 - 1][0] + mcCanvas.varRndX;
_local5 = mcCanvas.varDraw[_local3][_local2 - 1][1] + mcCanvas.varRndY;
mcCanvas.varRndX = Math.floor(Math.random() * 4);
mcCanvas.varRndY = Math.floor(Math.random() * 4);
_local6 = mcCanvas.varDraw[_local3][_local2][0] + mcCanvas.varRndX;
_local4 = mcCanvas.varDraw[_local3][_local2][1] + mcCanvas.varRndY;
mcCanvas.moveTo(_local7, _local5);
mcCanvas.lineTo(_local6, _local4);
_local2++;
}
_local3++;
}
}
_global.gStyle = {weight:2, color:0, alpha:100};
fncInit();
mcCanvas.onEnterFrame = function () {
if (this.varPress) {
this.varPoint++;
this.varDraw[this.varLine].push([_xmouse, _ymouse]);
}
fncDrawLine();
};
mcCanvas.onPress = function () {
this.varPress = true;
this.varPoint = 0;
this.varDraw[this.varLine] = new Array();
this.varDraw[this.varLine].push([_xmouse, _ymouse]);
};
mcCanvas.onRelease = function () {
this.varPress = false;
this.varLine++;
};