SharedObject using

I'm trying to use the part of the CAA SharedObject and fall on some issues. I created a SharedObject based on a property in the application. When the property I put the SharedObject on the new value. My goal is to be able to compare the values with everyone on the system so I set up a group of event handlers to see when properties are added or changed so I can see if any of them match my value. But when I debug the application in Flash Builder, added or modified properties never pull when I change it as another user in the room. Here is the code:

protected function cSession_synchronizationChangeHandler(event:SessionEvent):void
{
     if( event.type == SessionEvent.SYNCHRONIZATION_CHANGE )
     {
          var config:NodeConfiguration = new NodeConfiguration();
               config.modifyAnyItem = false;
               config.userDependentItems = true;

          sharedColor = new com.adobe.rtc.sharedModel.SharedObject();
          sharedColor.nodeName = cSession.userManager.myUserID + "_color";
          sharedColor.sharedID = "color";
          sharedColor.setNodeConfiguration(config);
          sharedColor.subscribe();
          sharedColor.addEventListener(SharedObjectEvent.PROPERTY_ADD, onPropertyAdd);
          sharedColor.addEventListener(SharedObjectEvent.PROPERTY_CHANGE, onPropertyChange);                    
     }
}
               
protected function onPropertyAdd(event:SharedObjectEvent):void
{
     trace('test');
}
               
protected function onPropertyChange(event:SharedObjectEvent):void
{
     trace('test');
}

Shouldn't the functions onPropertyAdd and late onPropertyChange when another user in the room adds or modifies something? What I am doing wrong?

Thanks in advance.

= Ryan

[email protected]

Hi Ryan,

Change this line to

sharedColor.nodeName = cSession.userManager.myUserID + "_color";

TO

sharedColor.nodeName = "a static & unmutating variable" + "_color"; // or justsharedColor.nodeName = "_color"

will fix the problem.

What is happening is that each user is to create its own node and update items in the node. Thus, each user was practically in his own world. Other users were not receiving updates as they will have listened to the sharedObject events in their node.

Thank you

Arun

Tags: Adobe LiveCycle

Similar Questions

  • The change of path SharedObjects between 3.4 and 3.5 AIR - now update to 3.7

    Hi all

    We were not aware of the change of SharedObject save path between 3.4 and 3.5, and all the people who have improved their game once the new application went live with lost 3.5 all their game progress data.  However, the NEW people who have downloaded the game had no problem.

    For devices that have improved their game (it was 3.1, now 3.5), SharedObjects have simply stopped working.  They cannot be loaded or saved to disk, and no new sharedobjects cannot be saved in the device-only kept in memory.  Every time that the user starts the game, the game thinks that they are a new user and they lose their progress - including their in-app purchases (consumables).

    We are now rebuilding the app with 3.7 AIR - I just check: someone who has downloaded the game costs with AIR 3.5 work SharedObjects (on the road again/broken). They now lose all their data in progress when they download the update to 3.7 and SharedObjects use once more the old path?

    If so is there a work around for these people?

    See you soon,.

    Peter

    We know what the problem is moving from 3.4 to 3.5, but what I'm asking is what the issues are moving from 3.5 to 3.6 (or in this case, 3.7).

    We have solved this problem now, but the workaround is relatively complicated.  Basically, we copy actual SharedObject binary files in the file system, to get them where we want them to be.  I hope that the paths on iOS do not change in the future!

    SITUATION 1

    Our original app is in the AIR 3.1. The sharedObject is called DATA1

    Those who have updated to 3.5 lost all the progress, and new no SharedObjects have been created

    Now if they update to the latest update 3.7, once more, they will continue to use DATA1 and progress will continue

    SITUATION 2 (the complex)

    People who have downloaded our 3.5 fresh app have SharedObject DATA2

    If now they update to the latest update 3.7, the application tries to use DATA1, therefore potentially to lose all the progress

    But because DATA1 contains no data, we try to manually load the DATA2.sol file from the file using "File" system and manually setting the path where the ground, and we copy DATA2 to DATA1 (if it exists). The player can then continue to progress.

    SITUATION 3

    Those who download the latest version of the app fresh (AIR 3.7) will create new SharedObject DATA1

    Thank you very much for the bug to Adobe, it has caused no end of trouble.

  • Why object shared side Server does not work for me?

    application.onPublish = function (client, p_stream)
    {
    myInfo var = SharedObject.get (p_stream.name);
    myInfo.setProperty ("live", true);

    }

    I put the sharedobject using the code above, now I can edit the video, but it is not defined (from the administration console, tab "shared object").

    Which may be a possible reason for this?

    Change your code below and see if it works (I mean, I do not say that it will work - I say just try - if it doesn't work - I'll look more into details)

    myInfo var;

    application.onPublish = function (client, p_stream)
    {
    myInfo = SharedObject.get (p_stream.name);
    myInfo.setProperty ("live", true);

    }

  • Using sharedObject to save clips nested

    Hello

    My first post here. I tried to save a few movieClips nested in an application I have class. I use the code below on the site of the Code of the Republic:

    var mySO:SharedObject = SharedObject.getLocal ("republicofcode");

    logo_mc.x = mySO.data.my_x;
    logo_mc.y = mySO.data.my_y;

    If (! mySO.data.my_y) {}
    logo_mc.x = 150;
    logo_mc.y = 100;
    }

    logo_mc.addEventListener (MouseEvent.MOUSE_DOWN, onDown);
    function onDown (e:MouseEvent): void {}
    my_mc var = e.target;
    my_mc.StartDrag ();
    }

    logo_mc.addEventListener (MouseEvent.MOUSE_UP, onUP);
    function onUP (e:MouseEvent): void {}
    logo_mc.stopDrag ();
    mySO.data.my_x = logo_mc.x;
    mySO.data.my_y = logo_mc.y;
    mySO.flush ();
    }

    logo_mc.buttonMode = true;

    The code works if you place the code in the main class or timeline. But what I need is to be able to manipulate and record the position of the movieClip that is in a container, the main class. Thanks in advance for any help.

    The problem you are having is because you can not serialize really accurately display objects- you need to store the State, and it's much easier if you can just hand over data to a newly created object and they just "to make."

    You need a design class that allows you to simply hand this "data" object to your MC so it can be put in the correct state. And then it's easy to store and retrieve the data object (and you don't need to go fishing around subcomponents for their properties for the purpose of data - it is already there waiting).

  • Is it possible to synchronize to execute the method using sharedObject?

    Hi all.

    I want to run remote process using sharedObject. Is this possible?

    I can share an object any.

    But I have no idea how synchronize the running method.

    Thanks in advance.

    Kevin.

    I'm stupid.

    I can run the syncHandler method.

  • Should I use SharedObjects?

    Hi all

    I do a basic program of office where I will need to put a lot of information from the user, and I'm trying to figure if SharedObjects is the answer. I do not plan on the passage of the application once it is installed on the computer either. I have a few questions:

    1. A shared object file get deleted when you uninstall the program Adobe Air from the computer? If not, when the file download deleted?
    2. Is there a size limit for the shared object file that you create? I know that for applications web, adobe player asks the user if more space is needed (I think that by default is 100K).

    In your case find tutorials Adobe AIR SQLLite

  • How can I count the number of participants in TextChatApp? (using SharedObject, FMS)

    Hi all.

    How can I count the number of participants?

    If the user 3animal enter the room, 3st user need to know that how many users is in the room.

    How can I find out how many users is in the room?

    Thanks in advance.

    Kevin.

    There's an sor acceptConnection() something like that on FMS, whenever you do not accept an increase in connection a counter.

    It's to you if you call all customers update handmade (custom method) so to increase counter or updating just the SharedObject that will synchronize with subscribers users.

    C

  • Question of SharedObject in OS 2.0 Simulator?

    When I run the following code (regardless of how often) I get an "undefined" message in the trace. The SharedObject does not any more or work differently with the 2.0 OS or I'm doing something wrong (he used to work, btw)?

    ...
    public function testapp()
    {
        var soTest:SharedObject = SharedObject.getLocal("test");
    
        trace(soTest.data.test);
    
        soTest.data.test = 5;
        soTest.flush();
        ...
    

    How silly that may be a person: there is this little flag on the Configurations Debug in Flash Builder, saying "clear application data on each launch" dialog and guess what... Yes, he has been selected...

  • SharedObject security

    Hello list!

    Does anyone know how the SharedObject is implemented in the Playbook SDK? My basic question is... is it possible to access the persistent objects of the apps 'foreign '? How do we treat the relevant Security information, then is there a concept?

    See you soon

    Marco

    That is right. Apps to perform in their own sanbox because it has the user and cannot read or write data from other applications. They can write and read data from shared however folders.

    You explicitly share files in this case.

    That should be done using the Air APIs, but I don't know the details.

  • The use of SQLite to store the JSON object

    Hello

    Can someone guide on how to store a JSON object returned after the use of the Adobe provide parser JSON which returns the native object

    as

    resultobject = JSON.decode (data)

    Where the data is a JSON string.

    The 'result' object is a complex subject, but I would like to keep this object because it is in the SQLite database.

    I tried BLOB for the column type but doesn't seem to work to store this object. Ideally, I prefer to use this way to avoid the redesign of the main code as I am currently using the SharedObject method.

    Any ideas?

    Can you just store the data as a BLOB string?

  • Something there significantly in SharedObject in SDK 0.9.3? (MUST BE A BUG?)

    Does anyone know if something has changed significantly in the implementation of SharedObject? I noticed a very strange behavior of my application. In my application one can track the items in list. The first time the application is used (with a SharedObject file no existing) he used to create the file (according to the documentation as well as my previous experience), we could create a list item and he would be saved in the SharedObject constantly.

    What I notice now is that the first time not all of the elements that are created are actually saved. If you restart the application, some elements have simply disappeared. The strange thing is that if you then create elements, they all are saved. It only happens the first time of use the App.

    I'm trying to determine to what are the conditions to reproduce, but thought to ask for more if anyone knows a change wrt SharedObject.

    Hey eugenevk,

    just passed through the sample application you posted (samples of love - gets more quick fixes! ). from what I found, was that you were not allocate the initial array in your data to the shared object ("points"). so from the very beginning it has been used as "null". so when you went ahead with him, he didn't know how to handle it correctly, which explains why you were getting inconsistent results. so when you started your application, your assigned correctly previous launch upward.

    Following is the corrected for sample you posted. Basically, make sure you check if the sharedObject has the updated initial table in place. from there you can use it as you did before. all the changes are in bold:

    MyApp.as:

    package {    import flash.display.Sprite;  import flash.events.Event;    import flash.events.MouseEvent;   import flash.net.SharedObject;
    
      import qnx.dialog.DialogSize; import qnx.dialog.PromptDialog;   import qnx.ui.buttons.LabelButton;    import qnx.ui.data.DataProvider;  import qnx.ui.listClasses.List;
    
      [SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
    
      public class MyApp extends Sprite {       private var btnAdd:LabelButton = new LabelButton();       private var dpItems:DataProvider = new DataProvider();        private var lstItems:List = new List();       private var soMyApp:SharedObject = SharedObject.getLocal("SomeNewSharedObject");      private var objItems:Array;
    
          public function MyApp() {         //do the check initially          if (soMyApp.data["items"] == null)            {             soMyApp.data["items"] = new Array();          }            //now set the objItems to the shared object's array           objItems = soMyApp.data["items"];
    
              // define list with checklists; dataprovider will be determined later         with(lstItems) {              width = 500;              height = 400;             x = 10;               y = 100;              allowDeselect = true;         }
    
              addChild(lstItems);
    
              with(btnAdd) {                width = 50;               x = 10;               y = 545;              addEventListener(MouseEvent.CLICK, onbtnAddClicked);              label = 'Add';            }
    
              addChild(btnAdd);
    
              for each(var obj:Object in objItems) {                if (obj != null) {                    dpItems.addItem({label:obj["entry"]});                }         }
    
              lstItems.dataProvider = dpItems;      }
    
          private function onbtnAddClicked(event:MouseEvent):void {         var prompt:PromptDialog = new PromptDialog();
    
              prompt.title = "New entry";           prompt.message = "Enter name:";           prompt.addButton("OK");           prompt.addButton("Cancel");           prompt.dialogSize = DialogSize.SIZE_SMALL;            // following - correct - code doesn't work because of a bug           // prompt.addEventListener(DialogEvent.DIALOG_BUTTON_CLICKED, onPromptButtonClicked);         // therefore use of the following         prompt.addEventListener(Event.SELECT, function onPromptButtonClicked(event:Event):void{               var currentList:Array = new Array();              var entryName:String = prompt.text;               var tmpObject:Object = {entry : entryName};
    
                  if (objItems != null) {                   currentList = objItems as Array;              }
    
                  currentList.push(tmpObject);
    
                  soMyApp.data["items"] = currentList;
    
                  // save data to shared object             soMyApp.flush();
    
                  // add entry to data provider of list             dpItems.addItem({label : entryName});         });           prompt.show();            } }}
    

    So, it was just at the beginning where were the errors. try to run the code above and see if it works. Good luck!

  • Adobe AIR. How to check users reviewed apps or not and how users many times used apps.

    Hello

    I want to check if users reviewed my apps or not and how users repeatedly open my apps.

    I checked some sites. but I could not find.

    Thank you.

    You can use sharedobject to store a number for each time that the user opens the application, and if they had hit your button "Edit". You can be sure that they continued to write a review, but at least you know they went to the review page.

    Here's the documentation on sharedobject:

    SharedObject - Adobe ActionScript® 3 (AS3) QAnywhere

  • SharedObject - Sound - as3

    How it is possible to record an audio object in Sharedobject!

    var meinsound1:blablameinsound1 = new blablameinsound1();

    var meinsound2:blameinsound2 = new blameinsound2();

    var sharedO:SharedObject;

    sharedO = SharedObject.getLocal ("blabla");

    var ktoenezufallarray:Array = new Array (meinsound1, meinsound2);

    var ahaktoenezufallarray:Array = new Array();

    button.addEventListener (MouseEvent.MOUSE_DOWN, buttonf);

    function buttonf(event:MouseEvent):void

    {

    Speicher();

    }

    If (sharedO.data.kmelodie)

    {

    ktext. Text = sharedO.Data.kmelodie [0]. ToString();

    ahaktoenezufallarray = sharedO.Data.kmelodie;

    ahaktoenezufallarray [0]. Play (0,1);

    sharedO.data.kmelodie [0] .play (0,1);

    }

    function speicher()

    {

    var savingArr:Array = new Array;

    for (var i: int = 0; i < ktoenezufallarray.length; i ++)

    {

    savingArr.push (ktoenezufallarray [i]);

    }

    sharedO.data.kmelodie = savingArr;

    sharedO.flush ();

    sharedO.data.kmelodie [0] .play (0,1);

    }

    You can save the name of your sound class string (in your sharedobject) and restore the class name using getDefinitionByName:

    var meinsound1:blablameinsound1 = new blablameinsound1();

    var meinsound2:blameinsound2 = new blameinsound2();

    var sharedO:SharedObject;

    sharedO = SharedObject.getLocal ("blabla");

    var ktoenezufallarray:Array = new Array (meinsound1, meinsound2);

    var ahaktoenezufallarray:Array = new Array();

    button.addEventListener (MouseEvent.MOUSE_DOWN, buttonf);

    function buttonf(event:MouseEvent):void

    {

    Speicher();

    }

    If (sharedO.data.kmelodie)

    {

    ktext. Text = sharedO.Data.kmelodie [0]. ToString();

    ahaktoenezufallarray = sharedO.Data.kmelodie;

    ahaktoenezufallarray [0]. Play (0,1);

    sharedO.data.kmelodie [0] .play (0,1);

    }

    function speicher()

    {

    var savingArr:Array = new Array;

    for (var i: int = 0; i<>

    {

    savingArr.push (getQualifiedClassName (ktoenezufallarray [i]));

    }

    sharedO.data.kmelodie = savingArr;

    sharedO.flush ();

    var:Class=Class(getDefinitionByName(sharedO.data.kmelodie[0])) C;

    her var: * = new C();

    Sound.Play (0,1);

    }

  • AS3 SharedObject of dynamic text field entry into other frameworks...

    Hello I have the script:

    var gTeams:Array = new Array (teamName1, teamName2, teamName3);

    var so:SharedObject = SharedObject.getLocal ("dataSO");

    var shared_data:String;

    for (var i: int = 0; i < gTeams.length; i ++) {}

    If (["team_name_" + i] so.data) {}

    gTeams [i] .text = so.data ["team_name_" + i];

    }

    }

    function saveTextF (): void {}

    for (i = 0; i < gTeams.length; i ++) {}

    so. Data ["team_name_" + i] = gTeams [i]. Text;

    }

    so. Flush();

    }

    In other settings, I have dynamic text fields:

    tName1, tName2, tName3.

    But I can't get the text in the text entry fields.

    How can I do?


    Thanks for your help

    Use instead of TextEvent.TEXT_INPUT Event.CHANGE:

    teamName1.addEventListener (Event.CHANGE, tName1F);

    function tName1F(e:Event):void {}

    .

    .

    .

    Note that the response number 8 is the right answer to your question.

  • SharedObject created in AS2 RangeError leads "the supplied index is out of bounds" on call to getLocal.

    To ensure backward compatibility, I want the old AS2 Shared Objects to work in the new version of my application (in Flash Player 11.1 edition) AS3. For some reason, this isn't the case.

    The AS3 code is simple:

    var so: SharedObject = SharedObject.getLocal ("ExistingAS2SharedObject", "/");

    Sharing objects created in AS3 work perfectly well in this scenario, but they break when they were initially created in AS2, causing the RangeError 'the supplied index is out of range"on the line of code above. I don't have access to the AS2 code (I use CC), but it saves and loads fine in itself, as well, so there should be no other problems.

    I made sure set default AMF3 encoding, even if I think it is redundant. Are there known issues with AS3 objects shared AS3 to open? Do I need a different approach? Thoughts?

    Well, I worked on this bug for a few weeks. I am convinced that it is a problem with Flash 100%. Either way, here is the solution that I think solves the problem:

    -Use the AMF0 encoding. If you must use AMF3, set the "local playback security" in "allow local files only". Runs the file SWF in the browser, will replace so the problem is still, however, the question will be is no longer standalone.

    -Set the "local playback security' to the 'network allow only." It will not work otherwise.

    Other things that affect the bug include:

    -If the shared object created AS2 has been consulted by AS3 at any time, the bug will occur is no longer. I think that it is because it is converted to AMF3. This is likely to occur if you test under "Allow local files only", for example.

    -The bug may not be reproducible if Flash Player uses a lot of RAM. For example, I had the Flash Player using 1.4 GB of RAM, and the bug seemed to be stopped, misconduct, making it difficult for me to debug.

    -The bug behavior can change or not the SWF file is running in the debugger or standalone. I didn't test it enough to confirm however.
    -Put a try/catch around the code does not stop the shared destruction object. In addition, the code returns if a different shared object tries to access it. Everything behaves as expected if the bug does not occur in the first place.

    Some things that do not affect the bug include:

    -Other elements of code and the library loaded in the application do not affect the issue (assuming it is not intended to interfere with the code of course). The bug occurs also in the classes and SWC files.

    -Flash Player version and the version of the IDE have no effect on the bug, it seems.

    I hope this helps someone else in the future! And I hope that I never had to run into this bug once again, haha.

Maybe you are looking for

  • Apple Remote Desktop tries to connect to some weird areas

    Firefox and osx elcapitan 10.11.4 15E65 It's so weird that lately my ARD tried to connect to areas randomly I searched on the web. Little Snitch reports she's trying to connect to 'gist.github' and the other day he tried to goto "krampus".  As I said

  • OfficeJet Pro 8600 more printer

    I just bought the printer more Officejet Pro 8600 & installed without any problems, but it doesn't connect to the internet/web services? It is connected to my home network & print etc, but when I try to activate the internet according to the guidelin

  • How can I turn off, log on my HP 11 e115nr touchsmart laptop

    How can I disable the log on my new HP Touchsmart 11 Notebook PC 11.6?   Someone knows something about this laptop? If what do you think about this? JohnD

  • Can I use a transceiver for a MS 6000 wireless mouse?

    to use a two-way radio for a ms 6000 with a multimedia keyboard 1.1 ms wireless wireless mouse?

  • 6000v2.0 wireless keyboard with Windows 7

    My Microsoft wireless keyboard 6000v2.0 does not always work with my Windows 7.  Is my questions compatible?  The mouse works fine, but I wonder about the keyboard.  It has new batteries and tried to synchronize but the green light does not illuminat