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

IMoaDrAssetCallback

Interface ID: IID_IMoaDrAssetCallback
Pointer type: PIMoaDrAssetCallback
Inheritance: IMoaMmPropOwner
Header file: driservc.h

Description

The IMoaDrAssetCallback interface is provided in Director by the class that implements IMoaMmAssetCallback, which is provided by through the asset initialization method IMoaMmXAsset::SetCallback(). To acquire IMoaDrAssetCallback, the asset can call QueryInterface() on IMoaMmAssetCallback.

This interface provides additional, Director-specific callback services to a media asset. In Director, an asset Xtra has both an external representation, implemented by the Xtra developer, and an internal representation, provided by Director. The Xtra developer defines custom behavior by implementing standard asset Xtra interfaces. This interface provides controlled access to the internal representation of the Xtra provided by Director.

Methods

Property owner
GetProp()
SetProp()
Internal cast member access
GetCMRef()
Scripting support
CallCMHandler()

CallCMHandler()

Syntax
CallCMHandler(MoaMmSymbol handlerName, MoaLong nArgs, PMoaMmValue pArgs, PMoaMmValue pResult, MoaBool * pHandled)
Parameters
handlerName
MoaMmSymbol representing the handler to call
nArgs
Number of arguments, excluding the Xtra instance in pArgs[0]
pArgs
Array of arguments, with the first valid argument at pArgs[1]
pResult
Pointer to a MoaMmValue to receive the result
pHandled
Boolean value indicated if call was processed
Returns
MoaError
Description
Calls a handler defined in the asset's cast member script. For CallCMHandler(), only the cast member script is checked; the message does not proceed up to the movie or frame level, as it does with the sprite SendMessage() call.

Caller supplies a 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, that is the handler existed in the cast member script. If message was not handled, it silently disappears and FALSE is returned.

GetCMRef()

Syntax
GetCMRef(PMoaDrCMRef pCMRef)
Parameters
pCMRef
Pointer to a MoaDrCMRef to receive the reference for the cast member associated with your asset
Returns
MoaError
Description
Gets the cast member reference for the cast member associated with your asset. This lets you determine the Director cast member with your asset is associated. The cast index supplied in this reference is relative to the active movie.

GetProp()

Syntax
GetProp(MoaMmSymbol symbol, PMoaMmValue pPropValue)
Parameters
symbol
MoaMmSymbol representing the property to get
pPropValue
Pointer to a MoaMmValue to receive the property's value
Returns
MoaError
kMoaErr_NoErr Property exists and value was returned
kMoaErr_BadParam Invalid pPropValue passed in
kMoaMmErr_PropertyNotFound Property isn't supported by this class
kMoaMmErr_InternalError Property exists but couldn't get due to internal err
kMoaMmErr_NoMemForString Couldn't allocate memory for string value data
kMoaErr_OutOfMem Couldn't allocate memory for other value data
Description
Gets any property of the cast member associated with your asset. This includes both built-in ones handled by the host application (such as name in Director for cast member name), as well as your own properties. If you retrieve your own properties, it may result in a callback to your own GetProp() method; be careful not to get stuck in a loop.

SetProp()

Syntax
SetProp(MoaMmSymbol symbol, ConstPMoaMmValue pPropValue)
Parameters
symbol
MoaMmSymbol representing the property to get
pPropValue
Pointer to a ConstPMoaMmValue containing the property value
Returns
MoaError
kMoaErr_NoErr Property exists and value was set
kMoaErr_BadParam Invalid pPropValue passed in
kMoaMmErr_PropertyNotFound Property isn't supported by this class
kMoaMmErr_InternalError Property exists, value ok, can't set--internal error
kMoaMmErr_NoMemForString Can't allocate memory for setting string value data
kMoaErr_OutOfMem Can't allocate memory for setting other value data
kMoaMmErr_IntegerExpected Type mismatch: integer value expected
kMoaMmErr_SymbolExpected Type mismatch: symbol value expected
kMoaMmErr_FloatExpected Type mismatch: float value expected
kMoaMmErr_StringExpected Type mismatch: string value expected
kMoaMmErr_PointExpected Type mismatch: point value expected
kMoaMmErr_RectExpected Type mismatch: rect value expected
kMoaMmErr_ValueTypeMismatch Type mismatch: other value expected (non-specific)
kMoaDrErr_CastMemberExpected Type mismatch: CMRef value expected
Description
Sets any property of the cast member associated with your asset. This includes both built-in ones handled by the host application (such as name in Director for cast member name), as well as your own properties. This may result in a call back to your own SetProp() method; be careful not to get stuck in a loop.

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