<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save Session State on client (not Flex Viewer) in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572825#M12908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ok, the SharedObject class works very well.&amp;nbsp; I created an "ApplicationsSettings" class that sets/gets all the appropriate values throughout the app.&amp;nbsp; That class then manages the SharedObject.&amp;nbsp; Then when the app loads in subsequent sessions, it checks the applicationsSettings properties and applies them where needed.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I now have an app that holds all the map settings (scale, layers turned on, map center, other settings) between sessions, if the user turns that feature on.&amp;nbsp; When the user turns that off, the app clears the SharedObject (through the ApplicationSettings class) and sets all app settings back to defaults.&lt;BR /&gt;&lt;BR /&gt;Next SharedObject task... bookmarks.&lt;BR /&gt;&lt;BR /&gt;Very nice.&lt;BR /&gt;&lt;BR /&gt;Thanks again Dasa.&lt;BR /&gt;-r&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;are you prepare to share?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's something we were about to work on too ... we might be able to extend your initial project?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Coomsie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Sep 2010 07:37:31 GMT</pubDate>
    <dc:creator>IainCampion</dc:creator>
    <dc:date>2010-09-16T07:37:31Z</dc:date>
    <item>
      <title>Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572821#M12904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've searched the forum and haven't seen anything very descriptive about this but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and this is more of a straight up Flex (4) question than the AGS API...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to save out current app settings, such as current map center, map scale, visible layers, etc... to a client side XML file or some such... to be loaded back up later when the user re-initializes the app from that pc?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 15:22:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572821#M12904</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-09-10T15:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572822#M12905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use a FileReference to save and load local files, but this require user interaction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're rather have something more like a browser cookie, then you can use SharedObject:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 15:38:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572822#M12905</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-09-10T15:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572823#M12906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Dasa, Will have a look at those.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 15:40:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572823#M12906</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-09-10T15:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572824#M12907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, the SharedObject class works very well.&amp;nbsp; I created an "ApplicationsSettings" class that sets/gets all the appropriate values throughout the app.&amp;nbsp; That class then manages the SharedObject.&amp;nbsp; Then when the app loads in subsequent sessions, it checks the applicationsSettings properties and applies them where needed.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I now have an app that holds all the map settings (scale, layers turned on, map center, other settings) between sessions, if the user turns that feature on.&amp;nbsp; When the user turns that off, the app clears the SharedObject (through the ApplicationSettings class) and sets all app settings back to defaults.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next SharedObject task... bookmarks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Very nice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again Dasa.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 21:22:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572824#M12907</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-09-15T21:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572825#M12908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ok, the SharedObject class works very well.&amp;nbsp; I created an "ApplicationsSettings" class that sets/gets all the appropriate values throughout the app.&amp;nbsp; That class then manages the SharedObject.&amp;nbsp; Then when the app loads in subsequent sessions, it checks the applicationsSettings properties and applies them where needed.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I now have an app that holds all the map settings (scale, layers turned on, map center, other settings) between sessions, if the user turns that feature on.&amp;nbsp; When the user turns that off, the app clears the SharedObject (through the ApplicationSettings class) and sets all app settings back to defaults.&lt;BR /&gt;&lt;BR /&gt;Next SharedObject task... bookmarks.&lt;BR /&gt;&lt;BR /&gt;Very nice.&lt;BR /&gt;&lt;BR /&gt;Thanks again Dasa.&lt;BR /&gt;-r&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;are you prepare to share?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's something we were about to work on too ... we might be able to extend your initial project?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Coomsie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 07:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572825#M12908</guid>
      <dc:creator>IainCampion</dc:creator>
      <dc:date>2010-09-16T07:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572826#M12909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Next SharedObject task... bookmarks.-r&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you already know, but that is what the Bookmark Widget in the ArcGIS Viewer for Flex does.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 13:33:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572826#M12909</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2010-09-16T13:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572827#M12910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I created a singleton class:&amp;nbsp; "ApplicationSettings.as"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
package org.larimer
{
 import flash.net.SharedObject;

 public class ApplicationSettings
 {
&amp;nbsp; // module level vars
&amp;nbsp; private static var _instance:ApplicationSettings;
&amp;nbsp; private var _so:SharedObject;
&amp;nbsp; 
&amp;nbsp; // constructor
&amp;nbsp; public function ApplicationSettings(enforcer:SingletonEnforcer)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; _so = SharedObject.getLocal("applicationSettings");
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; public static function getInstance():ApplicationSettings
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(ApplicationSettings._instance == null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ApplicationSettings._instance = new ApplicationSettings(new SingletonEnforcer());
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; return _instance;
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; // public properties
&amp;nbsp; // scale
&amp;nbsp; public function get scale():Number
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return _so.data.scale; 
&amp;nbsp; }
&amp;nbsp; public function set scale(value:Number):void
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; _so.setProperty("scale", value);
&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //more properties
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
class SingletonEnforcer{}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then reference the class in the various components:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private var _applicationSettings:ApplicationSettings = ApplicationSettings.getInstance();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To persist the map scale property:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_applicationSettings.scale = map.scale;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To retrieve the scale upon app load:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;map.scale = _applicationSettings.scale;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's the basic concept.&amp;nbsp; Map scale is an easy property to deal with but that's the idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572827#M12910</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2021-12-12T00:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572828#M12911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Maybe you already know, but that is what the Bookmark Widget in the ArcGIS Viewer for Flex does.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Bjorn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've not actually looked at the viewer for some time but perhaps should at some point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-r&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 19:39:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572828#M12911</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-09-16T19:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Save Session State on client (not Flex Viewer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572829#M12912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've not actually looked at the viewer for some time but perhaps should at some point.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Royce, the source code for Flex Viewer 2.1 (being released later this month) can be a treasure trove of Flex code for Flex API developers even if not planning to use the actual Viewer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 19:53:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/save-session-state-on-client-not-flex-viewer/m-p/572829#M12912</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2010-09-16T19:53:06Z</dc:date>
    </item>
  </channel>
</rss>

