I really need a fresh set of developer eyes to look at this one. I’ve been goofing around with learning the Drawing API and I cannot understand why this creates line segments rather than creating a free flowing line (if this needs more explanation, just let me know I really couldn’t think of another way to say it right now). Anyway, I’d like to see if anyone can explain that to me because I’m just confused. Any help or words are greatly appreciated.
To explain a little bit, I’ve just been going for the effect of drawing a line and whenever it is drawn over the 1 object I currently have on the stage, it reacts (only with a trace at the moment).
The code:
drawLevel = 0;
this.onMouseDown = function() {
this.createEmptyMovieClip("sharp_mc"+drawLevel, drawLevel);
this["sharp_mc"+drawLevel].sx = _xmouse;
this["sharp_mc"+drawLevel].sy = _ymouse;
this["sharp_mc"+drawLevel].drawing = true;
createShape.apply(this["sharp_mc"+drawLevel]);
drawLevel += 1;
};
createShape = function () {
this.onMouseMove = function() {
if (this.drawing) {
this.cx = _xmouse;
this.cy = _ymouse;
this.clear();
this.lineStyle(8, 0xFF9900, 50);
this.moveTo(this.sx, this.sy);
this.lineTo(this.cx, this.cy);
updateAfterEvent();
}
};
this.onMouseUp = function() {
this.drawing = false;
if (this.hitTest(photo1)) {
trace("You Chose The First One!");
}
};
};