Symbol 25 MovieClip Frame 1
Symbol 38 MovieClip Frame 1
Symbol 63 MovieClip Frame 1
Symbol 77 MovieClip Frame 1
Symbol 82 MovieClip Frame 1
trace("ruling on");
stop();
Symbol 82 MovieClip Frame 2
trace("ruling off");
stop();
Symbol 83 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 2
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 2
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 2
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 2
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 2
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 2
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 2
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 2
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 2
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 2
stop();
Symbol 126 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 2
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 2
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 2
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 2
stop();
Symbol 146 MovieClip Frame 3
stop();
Symbol 146 MovieClip Frame 4
stop();
Symbol 146 MovieClip Frame 5
stop();
Symbol 146 MovieClip Frame 6
stop();
Symbol 146 MovieClip Frame 7
stop();
Symbol 146 MovieClip Frame 8
stop();
Symbol 146 MovieClip Frame 9
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 2
stop();
Symbol 162 MovieClip Frame 3
stop();
Symbol 162 MovieClip Frame 4
stop();
Symbol 162 MovieClip Frame 5
stop();
Symbol 162 MovieClip Frame 6
stop();
Symbol 162 MovieClip Frame 7
stop();
Symbol 162 MovieClip Frame 8
stop();
Symbol 162 MovieClip Frame 9
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 2
stop();
Symbol 172 MovieClip Frame 3
stop();
Symbol 172 MovieClip Frame 4
stop();
Symbol 172 MovieClip Frame 5
stop();
Symbol 172 MovieClip Frame 6
stop();
Symbol 172 MovieClip Frame 7
stop();
Symbol 172 MovieClip Frame 8
stop();
Symbol 172 MovieClip Frame 9
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 2
stop();
Symbol 177 MovieClip Frame 3
stop();
Symbol 177 MovieClip Frame 4
stop();
Symbol 178 MovieClip Frame 1
function initializeButtons() {
mc_buttons.b_size1.onRelease = function () {
selectPenSize(1, true);
};
mc_buttons.b_size2.onRelease = function () {
selectPenSize(2, true);
};
mc_buttons.b_size3.onRelease = function () {
selectPenSize(3, true);
};
mc_buttons.b_new.onRelease = function () {
padNew();
};
mc_buttons.b_erase.onRelease = function () {
padErase();
};
mc_buttons.b_print.onRelease = function () {
padPrint();
};
mc_buttons.b_ruling.onRelease = function () {
padRuling(1 - sRuling);
};
mc_buttons.b_undo.onRelease = function () {
padUndo();
};
mc_palette.b_color1.onRelease = function () {
selectPenColor(1, true);
};
mc_palette.b_color2.onRelease = function () {
selectPenColor(2, true);
};
mc_palette.b_color3.onRelease = function () {
selectPenColor(3, true);
};
mc_palette.b_color4.onRelease = function () {
selectPenColor(4, true);
};
mc_palette.b_color5.onRelease = function () {
selectPenColor(5, true);
};
mc_palette.b_color6.onRelease = function () {
selectPenColor(6, true);
};
mc_palette.b_color7.onRelease = function () {
selectPenColor(7, true);
};
mc_palette.b_color8.onRelease = function () {
selectPenColor(8, true);
};
mc_palette.b_color9.onRelease = function () {
selectPenColor(9, true);
};
b_drawArea.onRelease = (b_drawArea.onReleaseOutside = function () {
stopDrawing();
if (b_drawArea.hitTest(_xmouse, _ymouse, false) == false) {
Mouse.removeListener(mouseListener);
Mouse.show();
mc_pen._visible = false;
}
});
b_drawArea.onRollOver = function () {
Mouse.addListener(mouseListener);
Mouse.hide();
mc_pen._visible = true;
mc_pen._x = _xmouse;
mc_pen._y = _ymouse;
};
b_drawArea.onRollOut = function () {
Mouse.removeListener(mouseListener);
Mouse.show();
mc_pen._visible = false;
};
mc_pen._visible = false;
}
function eventLog(kText) {
eventText = (kText + newline) + eventText;
mc_eventLog.t_eventsLog.text = eventText;
t_eventLog.text = eventText;
trace("E: " + kText);
}
function eventLogElement(kText) {
var _local1 = eventText.indexOf(newline);
eventText = (eventText.slice(0, _local1) + kText) + eventText.slice(_local1);
mc_eventLog.t_eventsLog.text = eventText;
t_eventLog.text = eventText;
}
function uiProcessKey() {
var kKey = Key.getCode();
var _local1 = Key.getAscii();
switch (_local1) {
case 49 :
selectPenSize(1, true);
return;
case 50 :
selectPenSize(2, true);
return;
case 51 :
selectPenSize(3, true);
return;
case 97 :
selectPenColor(1);
return;
case 98 :
selectPenColor(2);
return;
case 99 :
selectPenColor(3);
return;
case 100 :
selectPenColor(4);
return;
case 101 :
selectPenColor(5);
return;
case 102 :
selectPenColor(6);
return;
case 103 :
selectPenColor(7);
return;
case 104 :
selectPenColor(8);
return;
case 127 :
selectPenColor(9);
return;
case 61 :
padRuling(1 - sRuling);
return;
case 110 :
padNew();
return;
case 112 :
padPrint();
return;
case 122 :
padUndo();
return;
case 32 :
traceUndo();
}
}
var kERASE = 0;
var kDRAW = 1;
var kCHANGECOLOR = 1;
var kCHANGESIZE = 2;
var kDRAWSKETCH = 3;
var kERASESKETCH = 4;
var kNEWDRAWING = 5;
var eventText = "";
var nS = 0;
var iSketch = new Object();
var sPenSize = 2;
var sPenColor = 0;
var sRuling = 0;
var lastPenSize = 1;
var penColor = 1;
var isDrawing = false;
var newPending = false;
var xDrawing = 93;
var yDrawing = 42;
var pX = new Array();
var pY = new Array();
var nP = 0;
var smoothX = new Array();
var smoothY = new Array();
var qG = new Array(0.013986014, 0.076923077, 0.234265734, 0.34965035, 0.234265734, 0.076923077, 0.013986014);
var qType = new Array();
var qValue = new Array();
var qName = new Array("", "Color", "Size", "Draw", "Erase", "New");
var nQ = 0;
var mouseListener = new Object();
var fadeOutTimer0 = 0;
function padNew() {
if (newPending == false) {
eventLog("padNew");
fadeOutTimer0 = getTimer();
mc_fadeOut._alpha = 0;
mc_fadeOut._visible = true;
mc_fadeOut.gotoAndStop(sRuling + 1);
var _local3 = Stage.width;
var kdSX = Math.max(0, _local3 - 396);
mc_fadeOut.mc_ruling._width = 260 + kdSX;
addUndoQ(kNEWDRAWING, 0);
mc_fadeOut.onEnterFrame = function () {
var _local2 = getTimer() - fadeOutTimer0;
var _local1 = (_local2 / 200) * 100;
if (_local1 < 100) {
mc_fadeOut._alpha = _local1;
} else {
mc_fadeOut._alpha = 100;
newPending = true;
mc_fadeOut.onEnterFrame = null;
}
};
}
}
function eraseDrawing() {
var _local1 = 1;
while (_local1 <= nS) {
removeMovieClip(drawingAnchor["sketch" + _local1]);
_local1++;
}
nS = 0;
_local1 = 1;
while (_local1 <= nQ) {
qType[_local1] = 0;
qValue[_local1] = "";
_local1++;
}
nQ = 0;
mc_fadeOut._visible = false;
newPending = false;
}
function padPrint() {
eventLog("pad print");
print (drawingAnchor, "bframe");
}
function padUndo() {
if (nQ > 0) {
eventLog((("Undo: " + qName[qType[nQ]]) + ", ") + qValue[nQ]);
switch (qType[nQ]) {
case kCHANGECOLOR :
selectPenColor(qValue[nQ], false);
break;
case kCHANGESIZE :
selectPenSize(qValue[nQ], false);
break;
case kDRAWSKETCH :
removeMovieClip(drawingAnchor["sketch" + qValue[nQ]]);
nS--;
break;
case kNEWDRAWING :
mc_fadeOut._visible = false;
newPending = false;
}
qType[nQ] = "";
qValue[nQ] = "";
nQ--;
}
}
function addUndoQ(kType, kValue) {
nQ++;
qValue[nQ] = kValue;
qType[nQ] = kType;
}
function traceUndo() {
trace("--------------- undo Queueu: - ");
var _local1 = 1;
while (_local1 <= nQ) {
trace((((("Q" + _local1) + ": ") + qName[qType[_local1]]) + " = ") + qValue[_local1]);
_local1++;
}
}
function selectPenSize(kSize, kUndo) {
var _local1 = kSize;
eventLog("Pen size: " + _local1);
if (kUndo) {
addUndoQ(kCHANGESIZE, lastSize);
}
if (penColor == 9) {
setPenColor(lastColor);
}
setPenSize(_local1);
lastSize = _local1;
}
function setPenSize(kSize) {
switch (kSize) {
case 1 :
sPenSize = 2;
break;
case 2 :
sPenSize = 4;
break;
case 3 :
sPenSize = 10;
break;
case 4 :
sPenSize = 24;
}
hlPen(kSize);
}
function hlPen(kPen) {
var _local2 = kPen;
var _local1 = 1;
while (_local1 <= 3) {
mc_buttons["b_size" + _local1].gotoAndStop(1);
_local1++;
}
mc_pen.gotoAndStop(_local2);
if (_local2 < 4) {
mc_buttons["b_size" + _local2].gotoAndStop(2);
mc_pen.mc_penColor.gotoAndStop(penColor);
}
}
function selectPenColor(kColor, kUndo) {
var _local1 = kColor;
eventLog("Pen color: " + _local1);
if (kUndo) {
addUndoQ(kCHANGECOLOR, penColor);
}
if (_local1 == 9) {
setPenSize(4);
} else {
lastColor = _local1;
if (penColor == 9) {
setPenSize(lastSize);
}
}
setPenColor(_local1);
}
function setPenColor(kColor) {
var _local1 = kColor;
switch (_local1) {
case 1 :
sPenColor = 0;
break;
case 2 :
sPenColor = 5592405 /* 0x555555 */;
break;
case 3 :
sPenColor = 10066329 /* 0x999999 */;
break;
case 4 :
sPenColor = 26265;
break;
case 5 :
sPenColor = 3381555 /* 0x339933 */;
break;
case 6 :
sPenColor = 10027008 /* 0x990000 */;
break;
case 7 :
sPenColor = 6710988 /* 0x6666CC */;
break;
case 8 :
sPenColor = 16750848 /* 0xFF9900 */;
break;
case 9 :
sPenColor = 16777215 /* 0xFFFFFF */;
}
penColor = _local1;
hlColor(_local1);
}
function hlColor(kColor) {
var _local1 = 1;
while (_local1 <= 9) {
mc_palette["b_color" + _local1].gotoAndStop(1);
_local1++;
}
mc_palette["b_color" + kColor].gotoAndStop(2);
mc_pen.mc_penColor.gotoAndStop(kColor);
}
function padRuling(kRuling) {
sRuling = kRuling;
var _local2 = Stage.width;
var _local1 = Math.max(0, _local2 - 396);
mc_ruling.gotoAndStop(2 - sRuling);
mc_fadeOut.gotoAndStop(sRuling + 1);
mc_buttons.b_ruling.gotoAndStop(1 + sRuling);
if (sRuling == 1) {
mc_ruling._width = 260 + _local1;
mc_ruling._height = 1745;
mc_fadeOut.mc_ruling._width = 260 + _local1;
mc_fadeOut.mc_ruling._height = 1745;
}
eventLog(((sRuling == 0) ? "Ruling off" : "Ruling on"));
}
var lastSize = 1;
var lastColor = 1;
function newSketch() {
nS++;
drawingAnchor.createEmptyMovieClip("sketch" + nS, 1024 + nS);
iSketch = drawingAnchor["sketch" + nS];
iSketch.lineStyle(sPenSize, sPenColor, 100);
}
function startDrawing() {
if (newPending) {
eraseDrawing();
}
newSketch();
eventLog("sketch - mc:" + nS);
nP = 0;
pX[0] = _xmouse;
pY[0] = _ymouse;
iSketch.moveTo(pX[0] - xDrawing, pY[0] - yDrawing);
isDrawing = true;
}
function stopDrawing() {
addUndoQ(kDRAWSKETCH, nS);
isDrawing = false;
if (nP == 0) {
nP++;
pX[1] = pX[0] + 1;
pY[1] = pY[0];
}
smoothX[0] = pX[0];
smoothY[0] = pY[0];
var _local1 = 1;
while (_local1 <= nP) {
var _local3 = Math.max(0, _local1 - 3);
var _local2 = Math.max(0, _local1 - 2);
var k2 = Math.max(0, _local1 - 1);
var k3 = _local1;
var k4 = Math.min(_local1 + 1, nP);
var k5 = Math.min(_local1 + 2, nP);
var k6 = Math.min(_local1 + 3, nP);
smoothX[_local1] = ((((((pX[_local3] * qG[0]) + (pX[_local2] * qG[1])) + (pX[k2] * qG[2])) + (pX[k3] * qG[3])) + (pX[k4] * qG[4])) + (pX[k5] * qG[5])) + (pX[k6] * qG[6]);
smoothY[_local1] = ((((((pY[_local3] * qG[0]) + (pY[_local2] * qG[1])) + (pY[k2] * qG[2])) + (pY[k3] * qG[3])) + (pY[k4] * qG[4])) + (pY[k5] * qG[5])) + (pY[k6] * qG[6]);
_local1++;
}
smoothX[nP] = pX[nP];
smoothY[nP] = pY[nP];
iSketch.clear();
iSketch.lineStyle(sPenSize, sPenColor, 100);
iSketch.moveTo(smoothX[0] - xDrawing, smoothY[0] - yDrawing);
_local1 = 1;
while (_local1 <= nP) {
iSketch.lineTo(smoothX[_local1] - xDrawing, smoothY[_local1] - yDrawing);
_local1++;
}
}
mouseListener.onMouseMove = function () {
if (isDrawing) {
var kX = _xmouse;
var _local3 = _ymouse;
var _local2 = kX - pX[nP];
var _local1 = _local3 - pY[nP];
if ((Math.abs(_local2) > 10) || (Math.abs(_local1) > 10)) {
nP++;
pX[nP] = pX[nP - 1] + (0.5 * _local2);
pY[nP] = pY[nP - 1] + (0.5 * _local1);
}
nP++;
pX[nP] = kX;
pY[nP] = _local3;
iSketch.lineTo(pX[nP] - xDrawing, pY[nP] - yDrawing);
}
mc_pen._x = _xmouse;
mc_pen._y = _ymouse;
updateAfterEvent();
};
mouseListener.onMouseDown = function () {
startDrawing();
};
function resizePad() {
var kSX = Stage.width;
var _local3 = Stage.height;
var _local2 = Math.max(0, kSX - 396);
var _local1 = Math.max(0, _local3 - 568);
t_display.text = (("scale: " + kSX) + ", ") + _local3;
mc_glow.glow_T._width = 260 + _local2;
mc_glow.glow_B._width = 260 + _local2;
mc_glow.glow_L._height = 412 + _local1;
mc_glow.glow_R._height = 452 + _local1;
mc_glow.glow_TR._x = 337 + _local2;
mc_glow.glow_R._x = 373 + _local2;
mc_glow.glow_BR._x = 337 + _local2;
mc_glow.glow_BL._y = 490 + _local1;
mc_glow.glow_B._y = 546 + _local1;
mc_glow.glow_BR._y = 510 + _local1;
mc_pad.mc_padTR._x = 316 + _local2;
mc_pad.mc_padBR._x = 316 + _local2;
mc_pad.mc_padR._x = 316 + _local2;
mc_pad.mc_padBL._y = 468 + _local1;
mc_pad.mc_padBR._y = 488 + _local1;
mc_pad.mc_padT._width = 261 + _local2;
mc_pad.mc_padL._height = 413 + _local1;
mc_pad.mc_padR._height = 453 + _local1;
mc_pad.mc_padT._height = 524 + _local1;
mc_edge.edge_TR._x = 316 + _local2;
mc_edge.edge_BR._x = 316 + _local2;
mc_edge.edge_R._x = 336 + _local2;
mc_edge.edge_T._width = 260 + _local2;
mc_edge.edge_B._width = 260 + _local2;
mc_edge.edge_BL._y = 468 + _local1;
mc_edge.edge_BR._y = 488 + _local1;
mc_edge.edge_B._y = 508 + _local1;
mc_edge.edge_L._height = 412 + _local1;
mc_edge.edge_R._height = 452 + _local1;
b_drawArea.white_TR._x = 244 + _local2;
b_drawArea.white_BR._x = 244 + _local2;
b_drawArea.white_R._x = 244 + _local2;
b_drawArea.white_BL._y = 448 + _local1;
b_drawArea.white_BR._y = 448 + _local1;
b_drawArea.white_T._width = 229 + _local2;
b_drawArea.white_T._height = 464 + _local1;
b_drawArea.white_L._height = 433 + _local1;
b_drawArea.white_R._height = 433 + _local1;
mc_drawMask.white_TR._x = 244 + _local2;
mc_drawMask.white_BR._x = 244 + _local2;
mc_drawMask.white_R._x = 244 + _local2;
mc_drawMask.white_BL._y = 448 + _local1;
mc_drawMask.white_BR._y = 448 + _local1;
mc_drawMask.white_T._width = 229 + _local2;
mc_drawMask.white_T._height = 464 + _local1;
mc_drawMask.white_L._height = 433 + _local1;
mc_drawMask.white_R._height = 433 + _local1;
drawingAnchor.anchorBR._x = 249 + _local2;
drawingAnchor.anchorBR._y = 452 + _local1;
mc_fadeOut.mc_whiteArea.white_TR._x = 244 + _local2;
mc_fadeOut.mc_whiteArea.white_BR._x = 244 + _local2;
mc_fadeOut.mc_whiteArea.white_R._x = 244 + _local2;
mc_fadeOut.mc_whiteArea.white_BL._y = 448 + _local1;
mc_fadeOut.mc_whiteArea.white_BR._y = 448 + _local1;
mc_fadeOut.mc_whiteArea.white_T._width = 229 + _local2;
mc_fadeOut.mc_whiteArea.white_T._height = 464 + _local1;
mc_fadeOut.mc_whiteArea.white_L._height = 433 + _local1;
mc_fadeOut.mc_whiteArea.white_R._height = 433 + _local1;
mc_ruling._width = 260 + _local2;
mc_ruling._height = 1745;
mc_fadeOut.mc_ruling._width = 260 + _local2;
mc_fadeOut.mc_ruling._height = 1745;
mc_palette._x = 123 + (_local2 / 2);
mc_palette._y = 509 + _local1;
}
Stage.scaleMode = "noScale";
Stage.align = "TL";
var myListener = new Object();
myListener.onResize = function () {
resizePad();
};
Stage.addListener(myListener);
gotoAndStop (2);
Symbol 178 MovieClip Frame 2
initializeButtons();
selectPenSize(2, false);
selectPenColor(1, false);
padRuling(1);
mc_fadeOut._visible = false;
mc_palette.t_copyright.text = _parent.copyright;
stop();
Instance of Symbol 38 MovieClip "mc_pad" in Symbol 178 MovieClip Frame 2
onClipEvent (keyDown) {
_parent.uiProcessKey();
}