Drawing API (Multiple Freeflowing Lines Issue)
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!");
}
};
};
var drawLevel:Number = 0;
this.onMouseDown = function() {
var line:MovieClip = this.createEmptyMovieClip("sharp_mc" + drawLevel, drawLevel++);
line.moveTo(_xmouse, _ymouse);
line.lineStyle(8, 0xFF9900, 50);
createShape.apply(line);
};
function createShape():Void {
this.onMouseMove = function() {
this.lineTo(_xmouse, _ymouse);
updateAfterEvent();
};
this.onMouseUp = function() {
delete this.onMouseMove;
if (this.hitTest(photo1)) {
trace("You Chose The First One!");
}
};
}
#If you have any other info about this subject , Please add it free.# |
Author:
admin
03 21st, 2010 in
portal.gzui.com
edit