> I still have problems trying to understand localToGlobal. It doesn't
make sense to me. Can we rename it or change the signature? 

What don't you understand about localToGlobal()?
 
You pass in a point expressed in the "local" coordinate system of the
object that you're calling localToGlobal() on. It returns the same point
expressed in the "global" coordinate system of the Stage. For example,
the top-left corder of any visual component is (0, 0) in its own local
coordinate system. So myComponent.localToGlobal(new Point(0, 0)) would
give you the coordinates of myButton's top-left corner in Stage
coordinates.
 
- Gordon

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of dorkie dork from
dorktown
Sent: Thursday, April 19, 2007 8:49 AM
To: [email protected]
Subject: [flexcomponents]Total distance from edge of Application



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


 

Reply via email to