Drawing API (Multiple Freeflowing Lines Issue)

  • 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!");
    }
    };
    };


  • Yeah, that is exactly what I was looking for. I gotta read up more on this Drawing API the syntax just doesn't make sense to me sometimes. Any suggestions on where to learn more about it? I usually get books so if you know any let me know. Thanks a ton though, owe you one.


  • not sure I entirely understand the question, but is this the sorta thing you're looking for?
    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.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Drawing API (Multiple Freeflowing Lines Issue) , Please add it free.

    Jonas Brothers cd or what? Who's better for Nick Jonas - Miley Cyrus or Selena Gomez?