2010-11-23 14 views

答えて

1

見つかりソリューション自分 -

private static const CONST_PARAM:String = CONFIG::CONST_VALUE; 

そして、あなたのmxmlcコマンド/タスクが-defineオプションを使用して、パラメータを定義する必要があります - これは、あなたがActionScriptで何をすべきかです

http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html

条件付きコンパイル。あなたがターゲット要素の内側に置くことができ、プリコンパイルANTについては

1

:あなたはユニークなビルド時にコンパイルするたびにしたい場合は

<replaceregexp 
    file="yourFile.as" 
    match="private static const CONST_PARAM:String = '.*';" 
    replace="private static const CONST_PARAM:String = 'Your new const value';"> 
</replaceregexp> 

これは特に便利です。その後

<tstamp> 
    <format property="timestamp" pattern="MM/dd/yyyy hh:mm:ss" /> 
</tstamp> 
<replaceregexp 
    file="../src/Main.as" 
    match="private const BUILD_TIME:String = '.*';" 
    replace="private const BUILD_TIME:String = '${timestamp}';"> 
</replaceregexp> 

あなたMain.asクラスで:あなたのANT事前コンパイルで

package Main{ 
    import flash.display.Sprite; 

    public class Main extends Sprite{ 

     private const BUILD_TIME:String = 'dummy value'; 

     public function Main() { 
      trace("\n Main.as build-time:" + BUILD_TIME); 
     } 
    } 
} 

それが更新されていなかったので、それはあなたのswfファイルが予期せずに動作して、共通の問題を解決するのに役立ちますステージングサーバー。

関連する問題