### viewPoint

Syntax: | `the viewPoint of sprite` `whichFlashSprite`
| `the viewPoint of member` `whichFlashMember`
Description: | This property controls the point within a Flash movie that is displayed at the center of the sprite's bounding rectangle. This point is specified in Flash movie pixel units. The point values can be floating-point numbers.
| Changing the view point of a Flash movie sprite does not change the location of the sprite on the stage, only the view of the movie within the sprite's bounding rectangle. The view point is the coordinate within a Flash movie that is displayed at the center of the sprite's bounding rectangle. The view point is always expressed relative to the movie's origin (as set by the originPoint, originH, and originV properties). For example, if you set a movie's viewpoint at point(100,100), the center of the sprite will display the point within the Flash movie that is 100 Flash movie pixel units to the right and 100 Flash movie pixel units down from the origin point, regardless of where you move the origin point.
| The `viewPoint` property is specified as a Director point value; for example, point(100,200). Setting a Flash movie's view point with the `viewPoint` property is the same as setting the `viewH` and `viewV` properties separately. For example, setting the `viewPoint` property to point(50,75) is the same as setting the `viewH` property to 50 and the `viewV` property to 75.
| Director point values specified for the `viewPoint` property are restricted to integers, whereas `viewH` and `viewV` can be specified with floating-point numbers. When you test the `viewPoint` property, the point values are truncated to integers. As a rule of thumb, use the `viewH` and `viewV` properties for precision; use the `originPoint` property for speed and convenience.
| The `viewPoint` property can be tested and set. The default setting is point(0,0).
Example: | This handler makes a specified Flash movie sprite move down and to the right in increments of 5 Flash movie pixel units.

    on panAcross whichSprite
    	repeat with i = 1 to 10
    		set the viewPoint of sprite whichSprite = ¬
    			the viewPoint of sprite whichSprite + point(i * -5, i * -5)
    		updatestage
    	end repeat
    end

Related Lingo: | `viewH` property, `viewV` property, `viewScale` property

Previous | Next