From 616f18546c777108dd2b7b39d2e4f524bbfd42c1 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 27 Nov 2006 22:06:08 +0000 Subject: [PATCH] Return true if we succeeded. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4462 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/NetUtil.as | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/as/com/threerings/util/NetUtil.as b/src/as/com/threerings/util/NetUtil.as index 90d35d328..0e41094a3 100644 --- a/src/as/com/threerings/util/NetUtil.as +++ b/src/as/com/threerings/util/NetUtil.as @@ -8,15 +8,17 @@ public class NetUtil /** * Convenience method to load a web page in the browser window without * having to worry about SecurityErrors in various conditions. + * + * @return true if the url was unable to be loaded. */ public static function navigateToURL ( - url :String, preferSameWindowOrTab :Boolean = true) :void + url :String, preferSameWindowOrTab :Boolean = true) :Boolean { var ureq :URLRequest = new URLRequest(url); if (preferSameWindowOrTab) { try { flash.net.navigateToURL(ureq, "_self"); - return; + return true; } catch (err :SecurityError) { // ignore; fall back to using a blank window, below... } @@ -25,12 +27,13 @@ public class NetUtil // open in a blank window try { flash.net.navigateToURL(ureq); + return true; } catch (err :SecurityError) { Log.getLog(NetUtil).warning( "Unable to navigate to URL [e=" + err + "]."); } + + return false; // failure! } - - } }