Graphics Programs Reference
In-Depth Information
y
(0,0)
1
2
3
4
5
6
7
8
x
3
(0,0)
2
1
1
2
x
3
-4
-3
-2
-1
1
2
3
4
-1
4
-2
5
-3
6
Standard Coordinate System
Flash Coordinate System
y
Figure 5.2 Examples of Cartesian coordinate systems
Flash Coordinates and Screen Coordinates
Flash also uses a Cartesian coordinate system, shown in the right graphic of Figure 5.2,
albeit one which is a little strange until you get used to it. In order to position objects in
Flash, we will need to use Flash coordinates rather than screen coordinates. The origin
or (0,0) point in the screen coordinate system is typically located in the center of the
Flash Stage, and it is often convenient to use this. The origin of the Flash coordinate
system is located in the upper-left corner of the Stage as shown.
The main difference in the two systems is the vertical y-axis. In the screen coordinate
system, positive y-values are up, while in the Flash coordinate system, positive y-values
are down. To see what the transformation from the screen coordinate system to the Flash
coordinate system is, let's look at a simple example.
Figure 5.3 shows a corresponding point in both coordinate systems. To see the relation-
ship between these, note that the origin of the screen coordinate system is located at
the point (8,6) in the Flash coordinate system. From here to get to the desired point in
Flash units, we have to go 4 to the left and 2 up. Because the positive y-axis of Flash is
down, we will need to go up -2 to get to our point. From this we can write
(12,4) = (8,6) + (4,-2)
The point (12,4) in Flash coordinates is equal to the center point of the screen system
in Flash coordinates and, except for the negative y-axis value, the location of the point
in screen coordinates.
 
Search WWH ::




Custom Search