3

I have inherited an Adobe AIR application, and am attempting to debug it through Flash Builder 4.5. Within Flash Builder, when I look at one of the MXML files, I see warnings for each use of the [Bindable] tag:

[Bindable]
internal var selectedPreviousID:String=null;

[Bindable]
internal var recent:mx.collections.ArrayCollection;

The warning is:

Access of undefined property Bindable

There is an import for what I believe to be the appropriate library:

import mx.binding.utils.*;

And there are no missing semi-colons on the lines preceding each warning as per the suggestion in this blog post.

The project is configured to use Flex SDK 3.6.

Additionally the file will not load in the designer, with this warning:

Design mode: Error during component layout. Choose Design > Refresh to refresh design mode.

What am I missing? At runtime I am seeing a blank window - which I assume is the result of the bindings not being triggered. Is this tag not available in Flex SDK 3.6?

Jim Liddell
  • 514
  • 3
  • 13
  • could you post an example of how the bindable tags are exactly used? (and you can try [Bindable()], that might solve the problem). – Michiel Standaert Jun 02 '11 at 15:41
  • First, don't use designer, it's crap IMO. Pure code is more viewable. As for the warnings on Bindable, you shouldn't have a problem since Bindable is an integral part of Flex unless you mistyped something and the parser think you're referencing something else. – J_A_X Jun 02 '11 at 18:10
  • I've edited the question to include a sample of the code in question. I can't paste the entire class here due to copyright. I have tried [Bindable()] and it makes no difference. – Jim Liddell Jun 03 '11 at 07:33
  • This might be IDE install problem. [Bindable] is metadata, not property, IDE has gone mad. Does Bindable work in clean project? – alxx Jun 03 '11 at 07:37

1 Answers1

3

By removing elements from the code one by one, I discovered that the warnings somehow appear to have been caused by an <mx:WebService> element declaration earlier:

<mx:WebServiceid="service"
    wsdl="https://blah.com/blah?WSDL"
    operations='{{"Op1":this.method1()}}'/>
</mx:WebService>

Specifically, if I remove the inline 'operations' attribute - then the warnings against Bindable disappear. Must be triggering some issue with the parser.

Further testing reveals that any attributes that use the inline attribute syntax, e.g.:

properties='{{"outerDocument":this}}'

Trigger this parser issue. This code was generated by a decompiler, so it may be that it is not valid.

There is an alternative syntax for specifying the operations as XML nodes instead of an attribute:

<mx:WebServiceid="service"
    wsdl="https://blah.com/blah?WSDL"/>
    <mx:operation name="Op1" result="this.method1(event)">
    <mx:request>
        <token>{credentials.token}</token>
        </mx:request>
    </mx:operation>
</mx:WebService>
Jim Liddell
  • 514
  • 3
  • 13