Flex 数据绑定函数(非 getter)
我有一个 Flex 应用程序,它依赖于一个稍微抽象了 Flex 资源管理器的类。我使用的(纯 AS3)类扩展了 EventDispatcher,并处理本地化信息的运行时加载以及返回翻译后的标记。 我无法使用基础资源管理器,因为如果找不到令牌,我不希望它返回 null。
/endexposition
当我尝试使 getString 函数可绑定时,我的问题就出现了.
[Bindable(event="bundleLoaded")]
public function getString...
“bundleLoaded”事件被适当调度。这个功能在我参与开发的90%的应用程序中都能正常工作。但是,对于一个应用程序,我收到以下混淆错误:
1084:语法错误:s 之前需要右括号。资源=(项目名称)路径=(空)位置=第301行
在我添加 [Bindable...] 行之前,应用程序编译并运行(显然,减去了绑定),但在添加该行之后,它拒绝正确编译。任何应用程序或支持类的第 301 行都没有任何有趣的内容。
有什么建议吗?有人有类似的经历吗?
I've got a flex application that is dependent on a class that slightly abstracts flex's resourceManager. The (pure AS3) class I'm using extends EventDispatcher, and deals with runtime loading of localization information as well as returning the translated tokens. I can't use the base resourceManager, as I don't want it to return null if the token is not found.
/endexposition
My problem comes when I attempt to make my getString function bindable.
[Bindable(event="bundleLoaded")]
public function getString...
The "bundleLoaded" event is dispatched appropriately. This function works correctly in 90% of the applications I'm involved in the development of. However, for ONE application, I get the following obfuscated error:
1084: Syntax error: expecting rightbrace before s. Resource=(ProjectName) Path=(null) Location=line 301
The application compiles and works (minus the bindings, obviously) before I add the [Bindable...] line, but after I add that line it refuses to compile correctly. There is nothing even mildly interesting located on line 301 of any of the application or support classes.
Any tips? Anyone have a similar experience?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,在搜索生成的代码后,我发现了一个问题(该问题将被报告给flex sdk)。
我的代码将文本属性绑定到资源(用于本地化)。
该属性使用了三元运算。创建此绑定后,生成的代码会删除“:”和“?”来自我的三元运算,并导致了错误。
编译器把它变成了……
给我留下了一个很好的、模棱两可的编译器错误。谢谢你们的观看,伙计们!这个已经修好了
编辑:如果有人感兴趣:https://bugs.adobe.com/jira/browse/SDK -30937
Well, after searching through the generated code, I found an issue (which wiiiiill be bug reported to the flex sdk).
My code bound a text property to a resource (for localization).
That property used a ternary operation. Once I created this binding, the generated code stripped out the ":" and "?" from my ternary operation, and caused an error.
The compiler turned that into...
Leaving me with a nice, ambiguous compiler error. Thanks for looking, guys! This one's fixed.
EDIT: If anyone's interested: https://bugs.adobe.com/jira/browse/SDK-30937