views:

17

answers:

2

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?

+2  A: 

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

Sandro
A: 

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.

Simon Cave