--- In [email protected], Mark Carter <[EMAIL PROTECTED]> wrote:
>
>
> I have a MenuBar where the dataProvider is specified in MXML as an
XMLList.
>
> For the "enabled" attributes I do something like:
>
> enabled="{allowThis()}"
>
> However, to get databinding working I end up passing in the relevant
> bindable property and then ignore it within the implementation of
allowMe().
> For example:
>
> enabled="{allowThat(myBindableVar)}"
>
> This works, but IMHO is horrible because it requires either messing
up my
> API or creating a load of functions like:
>
> function allowThat(myBindableVar:Object):Boolean {
> allowThis();
> }
>
> Is there another approach? A standard approach?
how bout
[Bindable (event='allowChanged')]
function get isAllowed():Boolean {
return allowThis();
}
Then any time something happens that changes the way allowThis()
evaluates, do this:
dispatchEvent(new Event('allowChanged'));
HTH;
Amy