JSON sendXtMessage problem

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

didibus
Posts: 34
Joined: 09 Sep 2007, 19:31

JSON sendXtMessage problem

Postby didibus » 11 Aug 2008, 20:34

Hi,
I'm trying to send a params Object to my serverSideExtension using the JSON protocol and I'm getting this error:

any help?
thanx...

Code: Select all

Error: Error #2071: The Stage class does not implement this property or method.
   at Error$/throwError()
   at flash.display::Stage/get textSnapshot()
   at com.adobe.serialization.json::JSONEncoder/objectToString()
   at com.adobe.serialization.json::JSONEncoder/convertToString()
   at com.adobe.serialization.json::JSONEncoder/objectToString()
   at com.adobe.serialization.json::JSONEncoder/convertToString()
   at com.adobe.serialization.json::JSONEncoder/objectToString()
   at com.adobe.serialization.json::JSONEncoder/convertToString()
   at com.adobe.serialization.json::JSONEncoder/objectToString()
   at com.adobe.serialization.json::JSONEncoder/convertToString()
   at com.adobe.serialization.json::JSONEncoder/objectToString()
   at com.adobe.serialization.json::JSONEncoder/convertToString()
   at com.adobe.serialization.json::JSONEncoder()
   at com.adobe.serialization.json::JSON$/encode()
   at it.gotoandplay.smartfoxserver::SmartFoxClient/sendXtMessage()
   at gui::WriteLetterPannel/onSendBtnClicked()
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Aug 2008, 06:51

You seem to be transmitting a reference to the AS3 Stage class, which of course is not serializable.
Double check your code
Lapo
--
gotoAndPlay()
...addicted to flash games
didibus
Posts: 34
Joined: 09 Sep 2007, 19:31

Postby didibus » 07 Sep 2008, 19:23

Code: Select all

private function onSendBtnClicked(evt:MouseEvent):void
      {   
        var params:Object = new Object();
        params.destinataire = this.destinataire;
        params.title = this.titleMsg_txt.text;
        params.body = this.bodyMsg_txt.text;
                       
        Global.sfs.sendXtMessage("MBRequests", "SLRequest", params, SmartFoxClient.XTMSG_TYPE_JSON);

      }


this.destinataire is a String;
this.titleMsg_txt.text is a String;
this.bodyMsg_txt.text is a String;

When I use SmartFoxClient.XTMSG_TYPE_XML, it works perfectly, so I'm not certain why JSON is giving an error.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 64 guests