Allow deployment control over showing the help dialog on startup. Defaults to off.
authorAndy Allan <gravitystorm@gmail.com>
Wed, 15 Sep 2010 12:56:27 +0000 (12:56 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Wed, 15 Sep 2010 12:56:27 +0000 (12:56 +0000)
net/systemeD/potlatch2/help/HelpDialog.mxml
potlatch2.mxml

index a9d590f..704846a 100644 (file)
         PopUpManager.addPopUp(this, Application(Application.application), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, helpDialog_close);
+
+        // store whether the user has seen the help dialog before
+        var obj:SharedObject = SharedObject.getLocal("user_state");
+        obj.setProperty("help_shown","true");
     }
     
     private function helpDialog_close(evt:CloseEvent):void {
index 4a69acb..660b8d9 100755 (executable)
 
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);
+
+            // show help dialog on startup, if required
+            // show_help == always => on every startup
+            // show_help == once => show on first startup only
+            var show_help:String = loaderInfo.parameters["show_help"];
+
+            if (show_help == 'always' || (show_help == 'once' && obj.data["help_shown"] != "true")) {
+              new HelpDialog().init();
+            }
                }
                
                public function onMapError(event:MapEvent):void {