Kongregate issues - Javascript

I’m trying to get a test Unity game working on Kongregate. I upload the file successfully and I’m at the “preview” page testing the game.

The Unity game seems to communicate with the kongregateapi ok, but I’m not getting any messages back from the kongregateapi javascript. In Chrome I get the following error:

“Unsafe JavaScript attempt to access frame with URL” "from frame with URL "

I’ve tried the example code off the Kongregate website, the example project on the Unity site and some other random pieces of code around the net, nothing seems to work.

I’ve tested in Chrome, IE and firefox.

I’ve since solved this issue. There were a number of issues:

  1. The object the script is attached to must match the name passed to Kongregate API (Kongregate for the Unity example, “MyUnityObject” for the Kongregate example
  2. The Unity example used incorrect syntax to get access to the Unity object. Rather than “GetUnity()” it should have been “kongregateUnitySupport.getUnityObject()”
  3. The Unity example requires both “Kongregate” and “KongregateTest” to be attached to the object (and that object must be named “Kongregate”)