I have been trying to use the examples provided with no success at all.
I have followed this to the letter, not even getting the Application.ExternalCall to the browser.
I have found that the result of var u = new UnityObject2(); as specified in the link is that u is NULL. There is a note that that may happen if game is not fully loaded.
So how to delay my call till the game is loaded.
How can I tell that the player and assets are ready to go?
When you build your project with Web Player target, two files are in the output folder: xxxxx.html and xxxxx.unity3d. Please take a look at the content of html one - there are parts that must be included, in order for the whole stuff to work. Script used to dynamically include UnityObject2.js for example:
var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";
if (document.location.protocol == 'https:')
unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
Adding below code after above script should work properly. Adding it before will not, because UnityObject2 is not yet available.
var u = new UnityObject2();
After all of this something about your last suggestion/communication triggered the old brain cells.
I have been trying to do this through the Flash build.
I instead, this morning, tried a build of the Web Player and it all works as advertised. I wish I could do it through the Flash build though.
Thank you all for sticking with me through this discovery process.