Hi,

Inside the class;

var point:Point = new Point(0, 0);

// point is now stage
point = localToGlobal(point);

// point is now Application coords
point = Application(Application.application).globalToContent(point)

// should actually be the same since Application is the root display object
var xDistance:Number = point.x;

Peace, Mike

On 4/19/07, dorkie dork from dorktown <[EMAIL PROTECTED]>
wrote:

  I'm trying to find out the total distance in pixels my component is from
the edge of the application. I have some code that attempts to get the x and
y of the component but it doesnt work if its inside a container or
containers. I still have problems trying to understand localToGlobal. It
doesn't make sense to me. Can we rename it or change the signature?

var x:int = LocationClass.getLength(myComponent,Application,x); // returns
10
var y:int = LocationClass.getLength(myComponent,Application,y);

// or
var y:int = LocationClass.getDistanceTo(myComponent,Application,y);

thanks



--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to