You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking of an as3 compliment to config-alt.xml. How about something like:
public class Aerial
{
public static const DEBUG_MODE:Boolean = true;
public static const SERVER:Aerial = new Aerial("acme.com", "dev.acme.com");
public static const SERVER_PROTOCOL:Aerial = new Aerial("https://", "http://");
public static const SERVER_URL:String = SERVER_PROTOCOL + SERVER + "/server.php";
public static const USE_ENCRYPTION:Boolean = false;
private var _value:*;
private var _altValue:*;
public function Aerial(value:*, altValue:* = null)
{
_value = value;
_altValue = altValue;
}
public function toString():String
{
return String(DEBUG_MODE && _altValue ? _altValue : _value);
}
public function valueOf():Object
{
return (DEBUG_MODE && _altValue ? _altValue : _value);
}
}
It's a drop-in replacement for any existing projects that are only using string constants. Other types like Boolean will need to implement the 'valueOf()' to retrieve the proper type.
The text was updated successfully, but these errors were encountered:
I was thinking of an as3 compliment to config-alt.xml. How about something like:
It's a drop-in replacement for any existing projects that are only using string constants. Other types like Boolean will need to implement the 'valueOf()' to retrieve the proper type.
The text was updated successfully, but these errors were encountered: