      *  Returns the state with the specified name, or null if it doesn't exist.
      *  If multiple states have the same name the first one will be returned.
      */
-    private function getState(stateName:String):State
+    private function getState(stateName:String, throwOnUndefined:Boolean=true):State
     {
         if (!states || isBaseState(stateName))
             return null;

    }

    /**
     *  @private
     *  Returns true if the passed in state name is the 'base' state, which
     *  is currently defined as null or ""

            if (states[i].name == stateName)
                return states[i];
        }
        
        if (throwOnUndefined)
        {
            var message:String = resourceManager.getString(
                "core", "stateUndefined", [ stateName ]);
            throw new ArgumentError(message);
        }
        return null;
    }

