Alphabetical Scripting reference

The QT3 Asset Xtra provides the following new functions to control QuickTime sprite icons and sprites.

invertMask

Syntax:

    SetIconProperty(IconID@"QuicktimeSpriteIconTitle",#invertMask, state)
    GetIconProperty(IconID@"QuicktimeSpriteIconTitle",#invertMask)

Type: | Icon property
Example: | This property controls the way Authorware interprets a QuickTime movie's mask property. The state parameter can have these values:

| TRUE The QuickTime movie is drawn in the white pixels of the movie's mask.
| FALSE The QuickTime movie is drawn in the black pixels of the movie's mask.

| The `invertMask` property can be tested and set. The default `state` value is FALSE.
Example: | This script reverses the current setting of the invertMask property of a QuickTime movie named "Starburst."

    state := GetIconProperty(IconID@"StarBurst",#invertMask)
    SetIconProperty(IconID@"StarBurst",#invertMask, ~state)

Related Property: | `mask` icon property

loopBounds

Syntax:

    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#loopBounds, [startTime, endTime])
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#loopBounds)

Type: | Sprite property
Description: | This property sets the internal loop points for a QuickTime 3 sprite. The loop points are specified as an Authorware list:

    [startTime, endTime]

| The `startTime` and `endTime` parameters must meet these requirements:

| Both parameters must be integers that specify times in Authorware ticks (1/ 60th of one second).
| The values must range from 0 to the duration of the QuickTime movie.
| The starting time must be less than the ending time.

| If any of these requirements is not met, the QuickTime movie loops through its entire duration.
| The `loopBounds` property has no effect if the movie's loop property is set to `FALSE`. Authorware uses these rules to decide how to loop the movie:

| If the ending time specified by loopBounds is reached, the movie loops back to the starting time.
| If the end of the movie is reached, the movie loops back to the start of the movie.
| Authorware stops when it reaches the ending time specified by loopBounds or the end of the movie, whichever comes first.

| The `loopBounds` property can be tested and set. The default is [0,0].
Example: | This sprite script sets the starting and ending times for looping within a QuickTime sprite. Notice that the times are set by specifying the number of seconds, which is then converted to ticks by multiplying by 60.

    SetSpriteProperty(@"QuickTimeIcon",#loopBounds,[(16 * 60),(32 * 60)])

mask

Syntax:

    the mask of member whichQuickTimeMember

Type: | Icon property
Description: | This property specifies a black-and-white (1-bit) cast member to be used as a mask for QuickTime media rendered direct-to-stage. The QuickTime media appears in the areas where the mask's pixels are black. The `mask` property allows you to take advantage of the performance advantages of a direct-to-stage digital video while playing a QuickTime 3 movie in a non-rectangular area. The `mask of member` property has no effect on non-direct-to-stage cast members.
| Authorware always aligns the upper-left corner of the mask cast member with the upper-left corner of the QuickTime movie sprite. The mask cast member can't be moved and is not affected by the `center` or `crop` properties of its associated cast member.
| For best results, set a QuickTime 3 cast member's `mask` property before any of its sprites appear in the Presentation window. Setting or changing the mask property while the cast member is in the Presentation window can have unpredictable results (for example, the mask might appear as a "freeze frame" of the digital video at the moment the `mask` property took effect).
| Masking is an advanced feature; you may need to do some experimentation to achieve your goal.
| The `mask of member` property can be tested and set. To remove a mask, set the `mask of member` property to `VOID`.
| Note: Do not duplicate (using the Edit > Duplicate command) cast members for use as masks. Use copy-and-paste instead.
Example: | This script sets a mask for a QuickTime 3 sprite before Authorware begins to draw the frame.

    set the mask of member "Peeping Tom" to member "Keyhole"

Related Property: | `invertMask` property

mouseLevel

Syntax:

    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#mouseLevel, value)
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#mouseLevel)

Type: | Sprite property
Description: | This property controls how Authorware passes mouse clicks on a QuickTime sprite to QuickTime. Without the QT3 Asset Xtra, Authorware passes mouse clicks only on the QuickTime controller. The ability to pass mouse clicks within the sprite's bounding rectangle can be useful for interactive media such as QuickTime VR. The `value` parameter can have these values:

| `#controller` Pass clicks only on the movie controller to QuickTime. This is the standard behavior without the QT3 Asset Xtra.
| `#all Pass` all mouse clicks within the sprite's bounding rectangle to QuickTime.
| `#none` Do not pass any mouse clicks to QuickTime.

| The `mouseLevel` property can be tested and set. The default value is `#controller`.
Example: | This frame script checks to see if the name of the currently executing icon contains the string "QTVR." If it does, it sets the `mouseLevel` to `#all`; otherwise, it sets the `mouseLevel` to `#none`.

    if Find("QTVR", IconTitle(ExecutingIconID)) then
    		setSpriteProperty(ExecutingIconID, #mouseLevel, #all)
    	else
    		SetSpriteProperty(ExecutingIconID, #mouseLevel, #none)
    end if

QuickTimeVersion()

Syntax: | QuickTimeVersion()
Type: | Function
Description: | This function returns a floating-point value that identifies the current installed version of QuickTime.
| Windows users: If there are multiple versions of QuickTime 3.0 or later installed, `QuickTimeVersion()` returns the latest version. If a version before QuickTime 3.0 is installed, `QuickTimeVersion()` returns 2.1.2 regardless of the version installed.
Example: | This script uses `QuickTimeVersion()` to check whether QuickTime 3 is installed. If QuickTime 3 is installed, Authorware jumps to a file containing a QuickTime 3 video. If QuickTime 3 is not installed, Authorware jumps to a file that employs traditional Authorware animation.

    if QuickTimeVersion() >= 3 then
    	JumpFile"SplashVideo"
    else
    	JumpFile "SplashAnimated"
    end if

rotation

Syntax:

    SetIconProperty(IconID@"QuicktimeSpriteIconTitle",#rotation, degrees)
    GetIconProperty(IconID@"QuicktimeSpriteIconTitle",#rotation)
    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#rotation, degrees)
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#rotation)

Type: | Icon property; sprite property
Description: | This property controls the rotation of a QuickTime 3 sprite. This property does not rotate the sprite's bounding rectangle or the sprite's controller. Instead, it rotates the image around the image's center point within the sprite's bounding rectangle.
| If the sprite's `crop` property is set to `TRUE`, rotating the sprite frequently moves part of the image out of the viewable area; when the sprite's `crop` property is set to `FALSE`, the image is scaled to fit within the bounding rectangle (which may cause image distortion).
| You specify the rotation in the `degrees` parameter. The rotation property can be tested and set. The default value is 0.
Example: | This script rotates a QuickTime sprite 180 degrees.

    SpriteRotation := GetSpriteProperty(IconID@"QuickTime 3", #rotation)
    SetSpriteProperty(IconID@"QuickTime 3", #rotation, SpriteRotation + 180)

scale

Syntax:

    SetIconProperty(IconID@"QuicktimeSpriteIconTitle",#scale, [xPercent, yPercent])
    GetIconProperty(IconID@"QuicktimeSpriteIconTitle",#scale)
    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#scale, [xPercent, yPercent])
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#scale)

Type: | Icon property; sprite property
Description: | This property controls the scaling of a QuickTime 3 sprite. This property does not scale the sprite's bounding rectangle or the sprite's controller. Instead, it scales the image around the image's center point within the bounding rectangle. The scaling is specified as an Authorware list containing two percentages:

    [xPercent, yPercent]

| The `xPercent` parameter specifies the amount of horizontal scaling; the `yPercent` parameter specifies vertical scaling.
| When the sprite's `crop` property is set to `TRUE`, the scale property can be used to simulate zooming within the sprite's bounding rectangle. When the sprite's `crop` property is set to `FALSE`, the `scale` property is ignored.
| The `scale` property can be tested and set. The default value is [100.0000,100.0000].
Example: | This script zooms in on a QuickTime sprite.

    SetSpriteProperty(IconID@"SetSpriteProperty",#scale,[1.5,1.5])

translation

Syntax:

    SetIconProperty(IconID@"QuicktimeSpriteIconTitle",#translation, [xOffset, yOffset])
    GetIconProperty(IconID@"QuicktimeSpriteIconTitle",#translation)
    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#translation, [xOffset, yOffset])
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#translation)

Type: | Icon property; sprite property
Description: | This property controls the offset of a QuickTime 3 sprite's image within the sprite's bounding box. This offset is expressed in relation to the sprite's default location, as set by its center property. When `center` is set to `TRUE`, the sprite is offset relative to the center of the bounding rectangle; when `center` is set to `FALSE`, the sprite is offset relative to the upper-left corner of the bounding rectangle. The offset is set as an Authorware list:

    [xOffset, yOffset]

| The `xOffset` parameter specifies the horizontal offset, in pixels, from the sprite's default location; the `yOffset` parameter specifies the vertical offset. You can specify offsets as positive or negative integers.
| When the sprite's `crop` property is set to `TRUE`, the `translation` property can be used to mask portions of the QuickTime movie by moving them outside the bounding rectangle. When the `crop` property is set to `FALSE`, the `translation` property is ignored and the sprite is always positioned at the upper-left corner of the sprite's rectangle.
| The `translation` property can be tested and set. The default is [0,0].
Example: | This script assumes that the center property of a 320-pixel-wide QuickTime 3 sprite is set to `FALSE`. It moves the movie's horizontal translation point to the right edge of the sprite by 10 pixels. This has a "wipe right" effect, moving the sprite out of view to the right each time the script executes.

    horizontalPosition := GetSpriteProperty(IconID@"QuickTime 3",#translation)
    if horizontalPosition < 320 then
    	SetSpriteProperty(IconID@"QuickTime 3",#translation, horizontalPosition + [10,0])
    end if

volumeLevel

Syntax:

    SetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#volumeLevel, level)
    GetSpriteProperty(IconID@"QuicktimeSpriteIconTitle",#volumeLevel)

Type: | Sprite property
Description: | This property controls the sound volume of a QuickTime sprite. You can set the sound level from 0 (mute) to 256 (full volume). The `volumeLevel` property can be tested and set.
Example: | This script checks if the `volumeLevel` of the QuickTime 3 sprite is greater than 200. If it is, the script sets the `volumeLevel` to 150.

    if GetSpriteProperty(IconID@"QuickTime 3",#volumeLevel) > 200 then
    	SetSpriteProperty(IconID@"QuickTime 3",#volumeLevel,150)
    end if