4 Replies Latest reply on Mar 9, 2011 5:14 AM by broconne



      I am having a lot of trouble making sense of the local to global function in flex. 


      Essentially, I want to determine the distance between two objects in flex and then I am going to animate some text moving between the objects.


      Both objects are located within the same container, a VBox, that is inside of a Panel.


      I do the following:



      var object1Point:Point = object1.localToGlobal(new Point(0,0));

      var object2Point:Point = object2.localToGlobal(new Point(0,0));


      Then I trace those values.


      I get:

      object1Point.x = 863

      object1Point.y = 124


      object2Point.x = 753

      object2point.y = 699


      When I grab a screen capture, crop out the browser portion and examine pixel locations with GIMP I note that the X locations seem to be relativly accurate.  However, the y locations seem to be nowhere near accurate..  There is a maximum 200 pixel difference in y starting position... 


      Any suggestions on what could cause this discrepancy?