import com.actiontad.utils.SOManager; SOManager.establishLocalSO("TheNameOfTheSharedObject", "/"); //The first parameter is the name of the shared object you are trying to establish //if it does not already exist it is created. //The function will return the SharedObject. //You use the data property of the SharedObject to actually store any data. //To do that you use setDataOnLocalSO. (see below) //The second parameter is the local path for the shared object, which is normally just "/" //A "/" signifies that the SharedObject local path is the same as the swf file. //The local path is the full or partial path to the swf file that created the SharedObject. //It detsignates where the SharedObject will be saved. //After you have called this function you can reference the data property of the SharedObject //that was established by calling: var saveFileData:Object = SOManger.sharedObjectData;
import com.actiontad.utils.SOManager; var result:Boolean = SOManager.setDataOnLocalSO("nameOfPropertyToSet", valueToSet, "nameOfSharedObject", "/", false); //For this method you pass the name of the property you want to set on the data object, //the value you want it to be, which can be an Object, //the name of the shared object, and it's local path. //The last parameter provieds a way to have the SharedObject be flushed also after the propery is set. //Pass true if you would like the SharedObject to be flushed after the property has been set. //Flushing a local SharedObject immediatly writes it to a local file, in other words it gets saved. //The default option is false, //which means the SharedObject will be written to disk when the SharedObject session is over. //Which normally happens when the SWF file is closed. //If the data was set the method returns true, otherwise false. //If you pass true for flushing, if there is an error during flushing the method returns false.