1 Reply Latest reply: May 23, 2009 10:53 PM by shrawanrnc RSS

    SharedObject and Flash Lite 2 --has anybody made it work?

    McFrisco Community Member

      [URL]http://www.mediafire.com/?uytnzzyn4md[/URL]

       

       

      I made this little sample file to get a handle on SharedObjects.  Got it functioning just fine in Flash Player 10.  (AS 2.0)

      But I tried to make it work in the emulator, and couldn't get any phone that supports SharedObjects to read the data back into Flash once it's written out.

       

      I tried Nokia 6290,6600,7210, and others that have a device profile that shows support for the shared object.

      But none of them read data back off the disk.

       

      Has anybody been able to make the shared object work in the emulator?

      :<)McFrisco

       

        • 1. Re: SharedObject and Flash Lite 2 --has anybody made it work?
          shrawanrnc

          Yeah, it does work, both in emulator and mobile device. You should keep following things in mind while working with SharedObject in FL:

           

          1. Use a listener object event handler when reading the SO

          2. Make use of getSize() method to determine whethet the data exists in SO or not

          3. Reading/Writing to SO is slow on mobile devices so, you might want to give it some time by giving 1-2 frames interval

          4. Store the returned value of flush() method; it returns 'true' if data was successfully written, 'false' if not written and 'pending' if it is taking time

          5. Most important:

                 - You CANNOT share SharedObject data between SWFs even if you have given same SO name. One SWF can access it's own SO, if you create a copy of the same SWF then also it would not be able to pick the same SO.

                 - The SO changes everytime when you publish and deploy the app on a device.

           

          There is a very good article on DevNet about FL SO: http://www.adobe.com/devnet/devices/articles/persistent_data.html