A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: drawing lines - help!

  1. #1
    Junior Member
    Join Date
    Aug 2003
    Location
    Dorset, UK
    Posts
    12

    drawing lines - help!

    hi all,

    can anyone help me with thi problem?

    I have a movie clip (inst name object) containing another MC (inst name dot).

    i want to draw a line from the center point of object to the center point of dot, no problem:
    Code:
    this.createEmptyMovieClip("line"+clipID, depth);
    
    with (this["line"+clipID]) {
    	lineStyle(1, 0x000000, 100);
    	moveTo(0, 0);
                    lineTo(this.dot._x, this.dot._y);
    }
    dot is dragable. when you drag it i want the line to resize/redraw to follow dot.
    i did have:
    Code:
    this.onEnterFrame = function() {
    	this["line"+clipID].lineTo(this.dot._x, this.dot._y)
    which worked but drew new lines each time so i ended up with a screen full of lines
    I only want one line which streaches to where every dot is.

    any suggestions would be great

    Ian

  2. #2
    Flashkit Jedi

    Join Date
    Jul 2001
    Location
    Coruscant System
    Posts
    3,426
    Post the fla. I'll have a gander.

    XFM

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Location
    Dorset, UK
    Posts
    12
    ok, it'll need a bit of sorting out before i post it, its in a bit of a mess at the moment!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center