Lingo Dictionary > T-Z > viewPoint |  |

viewPoint

Syntax

    sprite(whichVectorOrFlashSprite).viewPoint
    the viewPoint of sprite whichVectorOrFlashSprite
    member(whichVectorOrFlashMember).viewPoint
    the viewPoint of member whichVectorOrFlashMember

Description

Cast member property and sprite property; controls the point within a Flash movie or vector shape that is displayed at the center of the sprite's bounding rectangle in pixel units. The values are integers.

Changing the view point of a cast member changes only the view of a movie in the sprite's bounding rectangle, not the location of the sprite on the Stage. The view point is the coordinate within a cast member that is displayed at the center of the sprite's bounding rectangle and is always expressed relative to the movie's origin (as set by the `originPoint`, `originH`, and `originV` properties). For example, if you set a Flash movie's view point at point (100,100), the center of the sprite is 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 general guideline, use the `viewH` and `viewV` properties for precision; use the `originPoint` property for speed and convenience.

This property can be tested and set. The default value is point (0,0).

Note: This property must be set to the default value if the scaleMode property is set to #autoSize, or the sprite will not display correctly.

Example

This handler makes a specified Flash movie sprite move down and to the right in increments of five Flash movie pixel units:

    on panAcross whichSprite
    	repeat with i = 1 to 10
    		sprite(whichSprite).viewPoint = sprite(whichSprite).viewPoint + point(i * -5, i * -5)
    		updateStage
    	end repeat
    end

See also

`scaleMode`,`viewV`, `viewH`, `viewScale`