DR Developer's Guide
DR Interfaces | DR Methods | DR Types and Misc API

IMoaDrSpriteCallback


Interface ID: IID_IMoaDrSpriteCallback
Pointer type: PIMoaDrSpriteCallback
Inheritance: IMoaUnknown
Header file: driservc.h

Description


The IMoaDrSpriteCallback interface is provided in Director by the class that implements IMoaMmSpriteCallback, which is provided through the sprite actor initialization method IMoaMmXSpriteActor::SetCallback(). To acquire IMoaDrSpriteCallback, the asset can call QueryInterface() on IMoaMmSpriteCallback.

This interface provides additional, Director-specific callback services to a media asset.

Methods

Acquiring IMoaDrMovie

GetMovie()

Sprite access

GetSpriteChanIndex()

Scripting support

SendSpriteMessage()

GetMovie()

Syntax

GetMovie(PIMoaDrSpriteCallbackThis,
PIMoaDrMovie FAR *ppIMoaDrMovie)

Parameters

This
Pointer to the IMoaDrSpriteCallback interface

ppIMoaDrMovie
PIMoaDrMovie FAR *

Returns

MoaError

Description

Gets the movie interface for the movie in which the sprite is appearing. You are responsible for releasing this interface when you're done with it.

GetSpriteChanIndex()

Syntax

GetSpriteChanIndex(PIMoaDrSpriteCallbackThis,
PMoaDrSpriteChanIndexpChanIndex)

Parameters

This
Pointer to the IMoaDrSpriteCallback interface

pChanIndex
PMoaDrSpriteChanIndex

Returns

MoaError

Description

Gets the sprite channel number for the Director sprite associated with this sprite instance. Channel numbers are 1-based.

SendSpriteMessage()

Syntax

SendSpriteMessage(PIMoaDrSpriteCallbackThis,
MoaMmSymbolhandlerName,
MoaLongnArgs,
PMoaMmValuepArgs,
PMoaMmValuepResult,
MoaBool FAR *pHandled)

Parameters

This
Pointer to the IMoaDrSpriteCallback interface

handlerName
MoaMmSymbol

nArgs
MoaLong

pArgs
PMoaMmValue

pResult
PMoaMmValue

pHandled
MoaBool FAR *

Returns

MoaError

Description


Sends a message along the standard message hierarchy starting with the sprite. The message proceeds along the path:

sprite --> cast member --> frame --> movie

until it is consumed by a script at some level. (If no such handler exists at a given level, the message proceeds to the next level. Alternatively, a Lingo script can intentionally pass a message to the next level using the pass Lingo command.

The caller supplies symbol for handler to call (name), the arguments (nArgs, pArgs), and a pointer to a MoaMmValue to receive a result, if any, from the handler call.

Upon return, pHandled is set to TRUE if the call was handled. If the message is not handled, it silently disappears and FALSE is returned.

This method is ideal for implementing widget-type sprite Xtras. For example, if you're implementing a button Xtra, you could send a buttonClicked message whenever the button was clicked. Developers could then handle this message by putting an on buttonClicked handler in the sprite script for any object in the hierarchy: sprite, cast member, frame, movie.). The Xtra could, of course, emit multiple messages, which would be needed to implement a multi-part widget such as a scrollbar.

Copyright © 1995-2007 Adobe Macromedia Software LLC, Inc.