Bindings failing when compiled through Flash IDE

折月煮酒 提交于 2019-12-11 16:34:02

问题


I have created an API in AS3 that uses Flex bindings. The API is being used by two other developers. I am delivering the API in an SWC that includes all code, including the required Flex libraries. The two other developers are building the API into AS3-only projects.

One developer is compiling using the Flex SDK through FDT. He includes the SWC in his project and he is able to bind any bindable property. When he uses ChangeWatcher.canWatch on a bindable property, it returns true.

The second developer is compiling using the Flash CS5 IDE. He includes the SWC in his project using the Actionscript settings window (merged into code). But none of the bindings, including ones internal to the API, are working. When he uses ChangeWatcher.canWatch on a bindable property, it returns false.

What could the Flash IDE be stripping out that causes ChangeWatcher to stop functioning? What is ChangeWatcher.canWatch actually checking? Is it the metadata, and if so, how can the metadata be preserved in the Flash IDE?


回答1:


As far as I know, data binding is only supported in Flex.




回答2:


It turns out the issue was that the [Bindable] metadata was being stripped out. To keep it in there I needed to trick the Flash IDE into keeping it. This can be done by enabling "Export as SWC" in the publish settings.

After doing this, all my bindings started working again.



来源:https://stackoverflow.com/questions/4036377/bindings-failing-when-compiled-through-flash-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!