Home Contact RSS

Drag Line

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Actionscript exercise with a line connecting movable movieClips.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

  1. // get x and y coordinates of the circles
  2. var ax = _root.point1._x;
  3. var ay = _root.point1._y;
  4. var bx = _root.point2._x;
  5. var by = _root.point2._y;
  6. var cx = _root.point3._x;
  7. var cy = _root.point3._y;
  8.  
  9. // draw line between them
  10. _root.createEmptyMovieClip ("line", 0);
  11. with (_root.line){
  12.   lineStyle (1, 0x999999, 100);
  13.   moveTo (ax, ay);
  14.   lineTo (bx, by);
  15.   lineTo (cx, cy);
  16.   lineTo (ax, ay);
  17. }

Source

Tags: , , , , ,

Related posts

flashden banner

Leave a Comment