Forum ActionScript 3.0 Connection.createMessage Error

Problems and discussions relating to ActionScript 3.0 here.

Connection.createMessage Error

Postby phil.peron » October 24th, 2010, 12:32 am

Hi All,

I'm currently trying to use Connection's createMessage method to, well... create a message. The issue I'm having is that it throws the following error:

Code: Select all
Error: object is not yet supported
        at bridge::Message/_add()
        at bridge::Message/add()
        at bridge::Connection/createMessage()
        [snip]


The code I'm trying to execute is simply:

Code: Select all
var message:Message = connection.createMessage("test", myArgs);


Has anyone else discovered this? And if the error is accurate, do we know when support will be included?

Thanks,

-Phil
phil.peron
 
Posts: 35
Joined: September 24th, 2010, 7:50 pm

Re: Connection.createMessage Error

Postby Benjaminsen » October 24th, 2010, 1:06 pm

Player.IO only support simple data types. You are calling it with an array. Propper use would be

Code: Select all
connection.createMessage("type", "arg1", "arg2", "arg3")


Alternatively you can parse it an array using apply

Code: Select all
var args:Array = ["type", "arg1", "arg2", "arg3"]
connection.createMessage.apply(null, args)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Connection.createMessage Error

Postby phil.peron » October 24th, 2010, 3:22 pm

Ah ha! I forgot.

Thanks. :)
phil.peron
 
Posts: 35
Joined: September 24th, 2010, 7:50 pm


Return to ActionScript 3.0