I have added a Flash movie in the pdf document with a Dynamic Text and actionscript that reads;
ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
function receivedFromJavaScript(value:String):void {
objectSelected.objectText.text = value;
}
The objective of the movie is to dynamically display the name of the mesh from the 3D annotation (in the same page) so that the movie is called back when user triggers a “Mouse over” event on a mesh.
The movie works fine when I send a call back command thru the console.
However, when I added :
var RMA = this.getAnnotsRichMedia(0)[0];
in the script attached to the 3D annotation, so I can call back the actionscript within the Mouse Event function by saying:
RMA.callAS("sendToActionScript", modelPart[ m ].mesh.name);
Console said:
Line: 11: Code: 24(0x18): this.getAnnotsRichMedia is not a function
Line: 11: Code: 21(0x15): undefined is not an object
I tried
var RMA = doc.media.getAnnotsRichMedia(0)[0];
but still same result.
Help please.
var RMA = host.getAnnotsRichMedia(0)[0];
Note however that the returned object is not considered by the API to be a valid RMA object (it has a type of "__External_Object_Wrapper__") and events do *not* flow bidirectionally between the 3D and document APIs - anything returned by the RMA will bubble to the document level, not into the 3D script. It's partly a bug, and partly intentional (security and all), so expect to see a whole heap of warning messages in the debug console if the two annotations try to talk to each other. Some of the conversations will still work, but some won't.