A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Drawing line between 2 mcs in different levels

  1. #1
    Junior Member
    Join Date
    Jun 2005
    Location
    Jewett City, CT
    Posts
    11

    Question Drawing line between 2 mcs in different levels

    I have a movieclip on the main stage of one end of a cable. Also in the main stage, I have another movieclip of an electronic breadboard-like item (a box with a few holes in it that looks like the female end of a computer cable) and within it I have a movieclip of the other end of the cable. I want to have a line drawn dynamically between each end of the cable, so that it looks like the 2 ends are connected. The problem, though, is that each mc is in a different coordinate system, so when I say to go from one movieclip's position to the other's position, it looks like the cable is off the screen to the left, when in reality it is on the right side of the screen.

    Can someone please tell me how to get the 2 coordinates to coincide with each other?

    Chris

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Take a look at the localToGlobal and globalToLocal functions. They are used for converting coordinates.

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