0

我创建了一个包含许多模块并使用 Parsley 框架的应用程序。Ant 用于构建应用程序。最近想用Resource Bundles,在系统中实现,在src下创建locale/en_US文件夹。我添加了一个portal.properties 文件,其中定义了我的所有字符串。

在我的模块中,我添加了元数据

<fx:Metadata>
    [ResourceBundle("portal")]
</fx:Metadata>

在 ant 构建文件中,我在 mxmlc 中添加了以下行。

<locale>@{locale}</locale>
<source-path path-element="${myapp.flex.app.locale}/{locale}"/>
<include-resource-bundles>portal</include-resource-bundles>

构建工作正常,当我部署应用程序并在浏览器中打开它时,Flash 播放器引发了许多错误。但如果我忽略这些消息,它工作正常。我的字符串被替换为属性文件中的值,但是如何停止抛出运行时错误?

我收到以下错误。

Error: Unable to load resource module from portal
at MethodInfo-637()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfo/errorHandler()

任何帮助将不胜感激。

4

1 回答 1

0

您是否在您的 ant 构建中包含以下内容

<keep-as3-metadata>ResourceBundle</keep-as3-metadata>

?

于 2011-01-21T15:59:08.933 回答