Skip to main content
Participant
April 15, 2014
Question

Getting information from a shared object on the server

  • April 15, 2014
  • 1 reply
  • 388 views

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);

                          }

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!

This topic has been closed for replies.

1 reply

Participant
April 24, 2014

Still an existing problem an updated version of the question can be found here:

http://stackoverflow.com/questions/23086608/getting-information-from-a-shared-object-on-the-adobe-media-server