Is it possible to send in custom objects defined in the Browser using SendMessage(), or are we limited to strings?

I want to send the custom object roomDetails to the Unity player. Is it allowed? If yes, is this the right syntax? If not is there any way to send this info without having to use a string and multiple delimiters,

In the browser

function someFunction(){

    var roomDetails = new Object(); 
    roomDetails.length = roomLength;
    roomDetails.width = roomWidth;
    roomDetails.roomID = roomID;
    roomDetails.XPos = roomX;
    roomDetails.ZPos = roomZ;
    roomDetails.doors = doors;
    roomDetails.from = facing;

    constructor.SendMessage("Avatar", "buildRoom", roomDetails);
}

In Unity attached to Avatar

function buildRoom (roomDetails : Object)
{
}

As far as i know you can only pass one simple datatype like: `int, float, String, ...`. The problem is that the class you've created "on-the-fly" is not known in .Net/Mono.

One way would be to use a JSON parser in JScript to serialize the object as string, but you have to deserialize and interpret it yourself in Unity.

I would go for the easiest way on the Unity side. A simple character-seperated-string will do in most cases. If you use an array in JScript you can simply use `.Join` to form a single string and in Unity `String.Split`

Edit: Misunderstood question and deleted answer, my apologies. >_<