Global coordinate (stage coordinate) local coordinate content coordinate system map coordinate (mappoint)
Flash and flex provide three different coordinate systems for different purposes
Global is (stage-level)
Local Coordinate System (component-level)
Content coordinate system (relative to the local coordinate system)
Map coordinate (mappoint)
The points in these coordinate systems can be converted, and there are corresponding methods. It seems that Adobe is very thoughtful. Let's talk about it one by one.
Global
The origin of this coordinate system is in the upper left corner of the entire flash stage. stagex and stagey of the mouseevent instance are values in this coordinate system,
Local
The coordinate origin is the upper left corner of the relative component. localx and localy in mouseevent are relative to the coordinate system,
Content
This is a abstraction of the contentmousex andContentmouseyThat's it. This is mainly for the component with a scroll bar. If there is a scroll bar, there must be a lot of content. The coordinates of the area occupied by the content are the coordinate system.
Map coordinate (mappoint)
This is mainly the coordinate point on map in ArcGIS.
The following official figure shows the relationship and position of the Three Coordinate Systems:
There are also ready-made methods for Coordinate Transformation
Contentmousex |
Returns the coordinates x of the mouse content. |
Contentmousey |
Returns the Y value of the mouse coordinate. |
Contenttoglobal |
Convert the content into global coordinates |
Contenttolocal |
Convert content into content coordinates |
Globaltocontent |
Convert global coordinates to content coordinates |
Globaltolocal |
Global to Local |
Localtocontent |
Coordinates from local to content |
Localtoglobal |
Local to global coordinates |
Map. toscreen (): mappoint ----> local coordinates
Map. localtoglobal (): local coordinates ---> Global coordinates
Map. globaltolocal (): Global coordinate ---> Local Coordinate
Map. tomapfromstage (): Global coordinate ---> mappoint
_ Sprite. globaltolocal (): Global coordinate ---> Local Coordinate
Flex Coordinate System