1 Reply Latest reply on Feb 2, 2009 9:14 AM by ia2

    probem with localtoglobal

    ruoyang Level 1
      I got a problem with localtoglobal. Suppose I have a canvas wihch is set as global canvas A. I set another canvas inside A as component, say B. And I set a canvas inside B as component, say C. Now I draw a point in C, and I want to get the x and y value of this point in the coordinates of B.
      In the B, if I use localtoglobal, it return the x and y value in the coordinates of A wihch is lager than B`s boundary. If I use localtocontent, it return the x and y value in the coordinates of C. So How could I get the value I want? Thanks you guys.

      BTW, how to post a pic here, I know it can tell you what I mean easily.
        • 1. Re: probem with localtoglobal
          ia2 Level 1
          Just do it in two steps..

          First use x = C.localToGlobal(yourpoint) to get your point on the global system.
          Then use B.globalToLocal(x) to change the global position to B's coord system.

          Local and Content are different in the way they handle padding and borders, not the elements they apply to.