Hi Tracy, I was really just checking that I hadn't missed anything obvious (as I'm intending to write a blog post which covers this area). So, is it safe to say that if you want a method to be triggered each time a bindable value changes, ChangeWatcher is the (only) way to go?
ChangeWatcher achieves what I want to do here but so does BindSetter to a lesser degree (i.e. the destination is essentially a method) ... but that seems to be stretching the intended use of an implicit setter. I was just checking that there weren't any other alternatives to consider. Cheers, Neil On Tue, Jun 24, 2008 at 6:02 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote: > ChangeWatcher. Is there some reason you do not want to use this? > > Tracy > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *nwebb > *Sent:* Tuesday, June 24, 2008 10:55 AM > *To:* [email protected] > *Subject:* [flexcoders] triggering a function (when an argument is a > bindable value)? > > > > 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 > > > > >

