Wrap ExternalInterface call in test - not all players support it
[potlatch2.git] / net / systemeD / halcyon / Map.as
index 2a91e87ab24544d66d52320a9893ef1dbe9304fc..8a95181a8325480c93bdb8a5ba45904ef8d53a7a 100644 (file)
@@ -150,10 +150,12 @@ package net.systemeD.halcyon {
             this.dispatchEvent(new Event(MapEvent.INITIALISED));
                        download();
 
-            ExternalInterface.addCallback("setPosition", function (lat:Number,lon:Number,zoom:uint):void {
-                updateCoordsFromLatLon(lat, lon);
-                changeScale(zoom);
-            });
+            if (ExternalInterface.available) {
+              ExternalInterface.addCallback("setPosition", function (lat:Number,lon:Number,zoom:uint):void {
+                  updateCoordsFromLatLon(lat, lon);
+                  changeScale(zoom);
+              });
+            }
         }
 
                // ------------------------------------------------------------------------------------------