1 Reply Latest reply: Apr 24, 2014 2:43 AM by dennington-bear RSS

    Getting information from a shared object on the server

    dennington-bear

      Hi all,
      I am currently stuck and cant find any answers anywhere!! So any help at all would be great!

      Currently Im trying to create a sharedObject on a client and send a string from the client containing information based on phone hardware(e.g. accelerometer and geolocation) to ams. From here I want to be able to access information from the sharedObject on the server in the main.asc to use elsewhere!
      This is where the problem is occurring I cant access the shared object sent by the client. I sent my shared object like this:

                          //best practice is to always check for a successful NetConnection

                                              protected function onNetStatus(event:NetStatusEvent):void

                                              {

                                                             switch(event.info.code)//Check for a successful NetConnection

                                                             {

                                            case "NetConnection.Connect.Success"://If the netConnection is a success#

                                                                                      so = SharedObject.getRemote("Data", nc.uri, false);//

                                                                                      so.connect(nc);//connect the sharedObject to the srever

                                                  so.addEventListener(SyncEvent.SYNC, syncHandler);//The sync listener

                                                                                      publishCamera(); //Publish the video

                                            case "NetStream.Publish.Start"://If the netStream is a success

                                            //etc 

                                                             }

                         }

                        protected function syncHandler(event:SyncEvent):void

                               {

                                       so.setProperty("id", aVar);

                                       trace("Local"+so.data.id);

                                }

       

      sharedObject.PNG

      Im just not sure how to access so from server side!! I know this works as I have tested it but if there are better ways to implement it I would be glad to get advice!