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


Macromedia Flash Communication Server MX
Macromedia Flash Communication Server MX
ISBN: 0735713332
EAN: 2147483647
Year: 2002
Pages: 200
Authors: Kevin Towes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net