Optimize a Runtime Shared Library : SharedObject « Data Model « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Data Model » SharedObjectScreenshots 
Optimize a Runtime Shared Library
Optimize a Runtime Shared Library
           

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        
            private var mySharedObject : SharedObject;

            private function readSharedObject() void
            {
                var sampleData1 : String = "data1";

                mySharedObject = SharedObject.getLocal"myData" );

                if mySharedObject.data.someData1 == undefined ) {
                    mySharedObject.data.someData1 = sampleData1;
                    mySharedObject.flush();
                    status.text += "mySharedObject data after assignment: " + mySharedObject.data.someData1 + "\n\n";
                else {
                    status.text += "mySharedObject already written to: " + mySharedObject.data.someData1 + "\n";
                }
            }
      
    </mx:Script>

    <mx:VBox width="100%" height="100%">
        <mx:Button label="read a shared object" click="{ readSharedObject() }" />
        <mx:TextArea id="status" width="100%" height="100%" />
    </mx:VBox>
</mx:Application>
    

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Use SharedObject to transfer dataUse SharedObject to transfer data
2.Create a SharedObject
3.Access a SharedObject Between Multiple Flash ApplicationsAccess a SharedObject Between Multiple Flash Applications
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.