Basically what i want to achieve is a sketch pad (within an image) with colour swatches (where ppl can draw on it, and change colour). I tried out this tutorial which works nicely, however, the funny part is, i can only draw STARTING from the left area. If i were to start drawing from the right, nothing appears. But if i start drawing from the left ONLY then i can continue drawing to the right. It’s weird and i dun understand why is this is so. Can anyone help me out pls? Wud really appreciate it. If possible, fast answer as i am stuck with my project. Hope to hear from someone soon.
By the way, this is the script that i used,
lineThickness = 0;
selectedColour = “0x000000”;
drawOn.onMouseDown = startDrawing;
drawOn.onMouseUp = stopDrawing;
function startDrawing() {
if (_xmouse<455) {
drawOn.lineStyle(lineThickness, selectedColour);
drawOn.moveTo(drawOn._xmouse,drawOn._ymouse);
drawOn.onMouseMove = drawLine;
}
}
function drawLine() {
drawOn.lineTo(this._xmouse, this._ymouse);
}
function stopDrawing() {
delete this.onMouseMove;
}
line0.onPress = function() {
lineThickness = 0;
};
line3.onPress = function() {
lineThickness = 3;
};
line6.onPress = function() {
lineThickness = 6;
};
colourRed.onPress = function() {
selectedColour = “0xFF0000”;
};
colourGreen.onPress = function() {
selectedColour = “0x00FF00”;
};
colourBlue.onPress = function() {
selectedColour = “0x000099”;
};
colourWhite.onPress = function() {
selectedColour = “0xFFFFFF”;
};
colourBlack.onPress = function() {
selectedColour = “0x000000”;
};
colourViolet.onPress = function() {
selectedColour = “0xCC00FF”;
};
colourPurple.onPress = function() {
selectedColour = “0x9900FF”;
};
colourYellow.onPress = function() {
selectedColour = “0xFFFF00”;
};