• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Appendix: IV Appendixes: Quick Reference... > Connect and Create a Local SharedObj...

Connect and Create a Local SharedObject (Flash)

Listing E.10 will connect the Flash client to a persistent local SharedObject on the client's hard disk. If the object does not exist, it will be created. There is a simple read and write sample included.

Listing E.10. Flash ActionScript for Creating a Local SharedObject

initLocalSharedObject = function () {
      trace(“Connect a Local SharedObject”);
      lcl_so.getLocal(“myLocalSharedObject”);
      // Write a property to the Local SharedObject
      lcl_so.test = “ kevin”;
      // Read a property from a Local SharedObject
      var my_var = lcl_so.test;
      trace(“ Local SharedObject Read Test: “+my_var);
      trace(“LocalSize: “+lcl_so.getSize());
};


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint