Hi,
I was looking at how you can trigger a function when an argument is a
bindable value....
e.g.
//userLevel is a bindable value & formatMessage is a function will be called
when userLevel changes
<mx:Label text="{formatMessage(userLevel)}" />
This is cool if you're just displaying a value in a text field. However,
what if you don't necessarily want to return a value (i.e. you don't have a
destination)?
Hopefully this will show what I mean:
private function stateManager(value:String):void
{
switch(value)
{
case "basic":
currentState = '';
break;
case "admin":
currentState = 'AdminState';
break;
default:
currentState = '';
}
}
BindingUtils methods and the binding tag both expect a destination, but in
this case there isn't one. Is the solution simply to use ChangeWatcher
instead, or can this be done using binding syntax?
Cheers