1 Reply Latest reply on Sep 3, 2010 8:37 AM by SpiritOfTheWinds

    LocalToGlobal?

    SpiritOfTheWinds

      Hello,

       

      I've got a little problem using the localToGlobal. Let me get the facts:

       

      I have, on the stage, a movie clip called "plan1" and in that MC, I have another MC called "place1".

       

      I want to obtain the place1 X and Y absolute location (not relative to the plan1 MC) so that I can place a tooltip besides it.

       

      I have this (in the MC actionscript):

       

      on(rollOver) {

           var myPoint:Object = {x:this._x, y:this._y}; // Where this would be the p"lace1" MC
          this.localToGlobal(myPoint); // Where I want my place1 (this) to obtain the global points of myPoint
          trace(myPoint.x + ":" + myPoint.y); // Doesn't return absolute position

      }

       

      In fact, it returns something sooo not what I'm looking for.

       

      If my place1 MC is at X:100, Y:100 of plan1 MC, which is in turn at X:50, Y:50 of stage, then the coords I'm looking for are 150:150! I can then positionate my tooltip easily with those coordinates.

       

      Any help would be appreciated!