Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To build on what <i>rmeador</i> said, and to help get you started, you are going to need to know how to use two classes in the FLEX3 API, <a href="http://livedocs.adobe.com/flex/3/langref/" rel="nofollow noreferrer">SharedObject</a> and <a href="http://livedocs.adobe.com/flex/3/langref/" rel="nofollow noreferrer">ExternalInterface</a>.</p> <p><b>SharedObject</b> will allow you to store and retrive data from a client computer and <b>ExternalInterface</b> will allow your actionscript to communicate with your javascript.</p> <p>Using shared object is simple. </p> <p>To put data onto a users machine just create a SharedObject and add properities to the sharedObject's data properity.</p> <pre><code> private var sharedObject : SharedObject = SharedObject.getLocal("myCookie"); sharedObject.data.DATA_FOR_THE_COOKIE = DATA; </code></pre> <p>Retriving data from the SharedObject is just as simple. Make sure the size of the SharedObject is greater than 0 (Make sure the SharedObject exists) and the just look up the properity names through the SharedObject's data properity.</p> <pre><code>if(sharedObject.size &gt; 0) // access data from cookie with -&gt; sharedObject.data.DATA_FROM_THE_COOKIE; </code></pre> <p>To pass the data stored in the SharedObject to your javascript you are going to need to use ExternalInterface.</p> <p>Lets say you have a javascript function to retrieve the variables</p> <pre><code>function retrieveVars( vars ){ // Do something with vars. } </code></pre> <p>To call this function from actionscript you will use</p> <pre><code>ExternalInterface.call("retrieveVars", DATA_ITEM_1, DATA_ITEM_2, ...); </code></pre> <p>Its that simple.</p> <p><i> Please note that this technique will not work if the client's flash player has its storage settings set at 0, or if the client's browser does not have ActiveX or NPRuntime. </i></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload