+1
Answered

Can I embed and/or control a Scene from within a Flash movie?

Eva 13 years ago updated by Gil 13 years ago 4
embed features api faq advanced flash

Answer

Yes, SitePal Gold accounts and higher support this functionality. For detailed instructions, see "API references & examples" on SitePal's support documentation page.
I saw the examples but I am still unable to use functions such as saySilent. I noticed that saySilent is called from vh_player which is defined as:
vh_player = MovieClip(ldr.content);

However when I also try to call the method from vh_player I keep getting an error saying:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at VHSSPlayerV5/saySilent()
at Avatarwebsite6_fla::civa_5/completeHandler()
I was able to fix my problem by calling the saySilent-method after a longer period of time. It would seem that the SitePal avatar needs to be fully loaded before one can call on the API functions.
Karasu -
The Scene needs to be loaded before it can accept API calls. The correct way to go about it is to wait for the -
"vh_sceneLoaded" event (or callback function in JS)

API calls made before this event is fired will not work and may have unexpected effects. This is described in the API Reference.

Using a longer wait time may not always work (depending on network circumstances). Best to update your code accordingly.

Hope this helps, regards
Gil
SitePal Team