                 return default_addr;
         }
 
+        /* Get a number from the given movie parameter, or the given default.
+           Returns null on error. First check for a null return, and then call
+           uint or whatever on the return value if no error. */
+        private function get_param_number(param:String, default_val:Number):Object
+        {
+            var spec:String;
+            var val:Number;
+
+            spec = this.loaderInfo.parameters[param];
+            if (spec) {
+                val = Number(spec);
+                if (isNaN(val))
+                    return null;
+                else
+                    return val;
+            } else {
+                return default_val;
+            }
+        }
+
         /* The main logic begins here, after start-up issues are taken care of. */
         private function proxy_main():void
         {
             var fac_url:String;
             var loader:URLLoader;
 
-            if (proxy_pairs.length >= MAX_NUM_PROXY_PAIRS) {
+            if (proxy_pairs.length >= max_num_proxy_pairs) {
                 setTimeout(proxy_main, FACILITATOR_POLL_INTERVAL);
                 return;
             }

                return;
            }

            local_addr = get_param_addr("local", DEFAULT_LOCAL_TOR_CLIENT_ADDR);
            if (!local_addr) {
                puts("Error: Local spec must be in the form \"host:port\".");

 * The address of the facilitator to use. By default it is
 * DEFAULT_FACILITATOR_ADDR. Both <HOST> and <PORT> must be present.
 *
 * max_clients=<NUM>
 * How many clients to serve concurrently. The default is
 * DEFAULT_MAX_NUM_PROXY_PAIRS.
 *
 * client=1
 * If set (to any value), run in client RTMFP mode. In this mode, rather than
 * connecting to a facilitator and attempting to serve clients, swfcat starts an
