A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: how do I make this?

  1. #1
    infidel! 0vidiu's Avatar
    Join Date
    Mar 2003
    Location
    ROmania
    Posts
    267

    how do I make this?

    hi...

    I need to make an object to get from point A to point B, following the dotted path.. How can I do that?
    tnx,
    ovidiu

  2. #2
    Senior Member pwned's Avatar
    Join Date
    Apr 2003
    Location
    Peoria Il
    Posts
    212
    you could either do some fairly complex math or a motion guide

  3. #3
    infidel! 0vidiu's Avatar
    Join Date
    Mar 2003
    Location
    ROmania
    Posts
    267
    really? I would like to know some AS ideeas to implement that... no motion tween...

  4. #4
    Senior Member pwned's Avatar
    Join Date
    Apr 2003
    Location
    Peoria Il
    Posts
    212
    this should do it
    code:

    var r:Number = 100;
    var a:Number = 0;
    var startPoint:Number = 200;
    var myMC:MovieClip= yourMovieClip;
    this.onEnterFrame = function() {
    // trace(r);
    myMC._x = r*Math.cos(a)+startPoint;
    myMC._y = r*Math.sin(a)+startPoint;
    r--;
    a += .2;
    if (r<0) {
    r = 0;
    }
    };


  5. #5
    infidel! 0vidiu's Avatar
    Join Date
    Mar 2003
    Location
    ROmania
    Posts
    267
    works like a charm.. tnx a lot!
    ovidiu

  6. #6
    Senior Member pwned's Avatar
    Join Date
    Apr 2003
    Location
    Peoria Il
    Posts
    212
    yw, i hope you can adapt it to work like you want

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