Search code examples
actionscript-3flash-buildermxmlc

Can't find how to use CONFIG:: directives properly


Let's say I have to compile two different versions of my .swf for different sites. The difference is in hostnames for the ajax and redirection, several minor tweaks in code and in graphics added to the project in .swc. I can switch different swcs easily, but the code tweaks are hard to manage easily. I've got

CONFIG::site1 
{
    private var _domainName:String = "site1.com";
}

CONFIG::site2
{
    private var _domainName:String = "site2.com";
}

FB brings up an error: 1151: A conflict exists with definition _domainName in namespace internal.
What I need is smthn like this in C:

#ifdef SITE1
char hostname[] = "site1";
#endif

#ifdef SITE2
char hostname[] = "site2";
#endif

Is there any way to use compile directives that way using mxmlc?

P.S. Everything works now


Solution

  • I think this documentation will help you.

    In your case it is something like the following:

    private var _domainName:String = NAMES::site;
    

    And mxmlc arguments will look like:

    -define+=NAMES::site,"'site1.com'"