Lingo Dictionary > T-Z > triggerCallback

 

triggerCallback

Syntax

sprite(whichQTVRSprite).triggerCallback
triggerCallback of sprite whichQTVRSprite

Description

QuickTime VR sprite property; contains the name of the handler that runs when the user clicks a hotspot in a QuickTime VR movie. The handler is sent two arguments: the me parameter and the ID of the hotspot that the user clicked.

The value that the handler returns determines how the movie processes the hotspot. If the handler returns #continue, the QuickTime VR sprite continues to process the hotspot normally. If the handler returns #cancel, the default behavior for the hotspot is canceled.

Set this property to 0 to clear the callback.

The QuickTime VR sprite receives the message first.

To avoid a decrease in performance, set the triggerCallback property only when necessary.

This property can be tested and set.

Example

This statement sets the callback handler for a QuickTime VR sprite to the handler named MyHotSpotCallback when the playback head first enters the sprite span. Every time that hotspot is triggered, the MyHotSpotCallback handler is executed. When the playback head leaves the sprite span, the callback is canceled.

property pMySpriteNum, spriteNum

on beginSprite me
	pMySpriteNum = me.spriteNum
	sprite(pMySpriteNum).triggerCallback = #MyHotSpotCallback 
end 

on MyHotSpotCallback me, hotSpotID 
	put "Hotspot" && hotSpotID && "was just triggered" 
end 

on endSprite me 
	sprite(pMySpriteNum).triggerCallback = 0 
end