Load the content via XML in webplayer

Hi everyone,

In my project the first thing that I have to do is to load a XML. From that XML I extract all the info I need to show in the program.

My problem is that I can´t achieve to make it work in webplayer. I want to call a web page that launchs my application. Something like the example:

unityObject.embedUnity(“unityPlayer”, “Example.unity3d”, 600, 450, null, null, unityLoaded);

Ok, and then in the unityLoaded function I use the SendMessage():

if (result.success) {
var unity = result.ref;
unity.SendMessage(“MyObject”, “MyFunction”, “URL of my XML”);
}

My goal is to call the webpage and pass to my unity content the XML that it has to load.
But It doesn´t work :frowning:

Some questions that I have:

  • Can I show debug alerts on the browser screen from unity content? To know where my program goes.
  • How you would do that I want to do?

thank you everybody!!

It seems a lot people gets confused with the unityLoaded callback of embedUnity. The callback is invoked when the Unity webplayer plugin has successfully loaded and started. At this point the player had just started to load your .unity3d content.

If you want to inform the webpage that your game content is loaded use Application.ExternalEval in Unity to call a JScript function or directly inject JScript into the webpage.