Assign relations to function keys
[potlatch2.git] / net / systemeD / potlatch2 / FunctionKeyManager.as
index 03165b81fbec2c25745a96443d94f2ab01d7615d..f3ab21500e6517408d0a24f75fa6dbf64507a387 100644 (file)
@@ -44,7 +44,7 @@ package net.systemeD.potlatch2 {
                        keys[fkey]={ code:code, value:value };
                        var obj:SharedObject=SharedObject.getLocal("user_state","/");
                        obj.setProperty('F'+fkey,{ code:code, value:value });
-                       obj.flush();
+                       try { obj.flush(); } catch (e:Error) { trace("Error: "+e.toString()); }
                        dispatchEvent(new Event("key_changed"));
                }
 
@@ -54,7 +54,7 @@ package net.systemeD.potlatch2 {
                                keys[Number(oldKey.substr(1))]=null;
                                var obj:SharedObject=SharedObject.getLocal("user_state","/");
                                obj.setProperty(oldKey,null);
-                               obj.flush();
+                               try { obj.flush(); } catch (e:Error) {}
                        } else {
                                setKey(Number(key.substr(1)),code,value);
                        }
@@ -80,6 +80,5 @@ package net.systemeD.potlatch2 {
                        listeners[keys[fkey].code](keys[fkey].value);
                        return true;
                }
-               
        }
 }