2010-11-23 89 views

回答

1

对于ANT预编译,你可以把你的目标的元素:

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

如果你想要一个独特的建造时间每次编译时这是非常有用的。在您的ANT预编译:

<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类

然后:

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意外行为,因为它没有更新的常见问题登台服务器。

相关问题