Thanks. The mistake was in the creation sequence. The injection
container hadn't been initialized since I put it in the
creationComplete of the app and TestClass got created sooner. :-)
On Apr 1, 2:38 pm, Josh McDonald <
j...@joshmcdonald.info> wrote:
> A couple of things to check:
>
> 1) SessionVars has [Bindable] fields
> 2) Make sure your BindingUtils.bindSetter() call uses a String for the chain
> parameter. If you want to bind to foo.bar, use
> BindingUtils.bindSetter(myFunction, foo, "bar"). To bind to foo.bar.baz, use
> BindingUtils.bindSetter(myFunction, foo, ["bar","baz"])
>
> -Josh
>
> 2009/4/1 nishantkyal <
nishant.k...@gmail.com>
>
>
>
>
>
> > Hey,
>
> > I've a few models which I'm injecting as singletons using smartypants
>
> > In application.mxml
> > injector.newRule().whenAskedFor(SessionVars).useSingleton()
>
> > In a class called TestClass --
>
> > [Inject] public var sessionVars:SessionVars;
> > public function TestClass() {
>
> > SmatyPants.injectInto(this);
> > BindingUtils.bindSetter(sessionUpdated, sessionVars, someVar);
> > }
> > private function sessionUpdated(someVar:String):void {}
>
> > My method sessionUpdated is not called when someVar is changed.
>
> > Is there a way to call a method using live rules whenever a property
> > of an injected object changes?
>
> > Hope I explained my situation clearly enough.
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> Josh 'G-Funk' McDonald
> -
j...@joshmcdonald.info