Create an MXML-Based Module
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> private var lso : SharedObject; private function removeSharedObject() : void { var sampleData1 : String = "data1"; var sampleData2 : String = "data2"; lso = SharedObject.getLocal( "mylso" ); lso.data.someData1 = sampleData1; lso.data.someData2 = sampleData2; lso.data.someData3 = "sampleData2"; lso.flush(); status.text = "\ndata1: " + lso.data.someData1 + "\ndata2: " + lso.data.someData2 + "\ndata3: " + lso.data.someData3; delete lso.data.someData1; status.text += "\n\nlso after deleting lso.data.someData1" + "\ndata1:" + lso.data.someData1 + "\ndata2:" + lso.data.someData2 + "\ndata3:" + lso.data.someData3; lso.clear(); status.text += "\n\nlso data after calling clear()" + "\ndata1: " + lso.data.someData1 + "\ndata2: " + lso.data.someData2 + "\ndata3: " + lso.data.someData3; } </mx:Script> <mx:VBox width="100%" height="100%"> <mx:Button label="remove a shared object" click="{ removeSharedObject() }" /> <mx:TextArea id="status" width="100%" height="100%" /> </mx:VBox> </mx:Application>