1 Reply Latest reply on Dec 21, 2007 4:31 AM by peterent

    moving lines with actionscript code

    FlexBee Level 1
      Hi friends,
      I am creating a graphical representation of nodes and edges (i.e. lines and circles). Nodes are the end points of the edges. If I drag the node, the corrosponding edges should also be moved and redrawn to new coordinates. for eg, suppose my edges coordinates are x1,y1,x2,y2 and my two corrosponding nodes coordinates are x1,y1 and x2,y2. Now I am dragging the first node to some other location, let's say x1+20, y1+20 then my edge should be redrawn to x1+20,y1+20,x2,y2 . Pls guide me what I should do..??
        • 1. Re: moving lines with actionscript code
          peterent Level 2
          I would create separate objects for each node and line - say a Shape or Sprite (depends on what you are doing with them). This way you can layer them and move them independently.

          If you make classes out these objects and the objects know to draw themselves then you let the objects deal with their shape and all you do is position and size them.