Recipe 1.34. Positioning Elements PreciselyProblemYou want to position elements with numeric precision. SolutionSet the element's X and Y coordinates in the Property inspector. DiscussionEvery element in Flash, whether it is hand-drawn artwork or a movie clip symbol, has a single registration point, which represents the location of the element. Though an element can be as large as you want, its registration point is always a single dot, a twentieth of a pixel in size. When you position an element on stage, its X, Y coordinate is the location of its registration point. Using the X and Y fields of the Property inspector, you can specify the position for the selected element with numeric precision. (Remember that the stage's origin, [0,0], is in its upper-left corner.) Positioning with numeric precision is useful when you want to lay out elements of an animation over time, space elements out according to a mathematical pattern, or make room for elements created at runtime using ActionScript. The location of an element's registration point can vary. For artwork that you've drawn using Flash tools, the registration point is always the upper-left corner of the element. Thus, if an element is positioned at 0,0, then its upper-left corner coincides with the upper-left corner of the stage. Other Flash elements, including symbols by default, have registration points at the center. For these elements, a positioning of 0,0 means that their centers are aligned with the upper-left corner of the stage, and that some of their contents are likely offstage. |
Tripod >> 3pod Tips & Learning and manuals for educations