First of all, I just remembered that you actually can bind to a style.
It was probably Flex 1.5 that didn't let you do that....
But anyway, if you have the name of a class, you can get it like this:
getDefinitionByName("mx.Effects.easing." + TheEasingClass);
But you would have to also reference the class somewhere else in your
code, for that to work, otherwise it won't get added to the swf. Given
that - and assuming you are choosing these values from a combobox or
list - you might as well just add references to the classes in the
data provider. e.g:
import mx.effects.easing.*;
easingChooser.dataProvider = [{label:"Cubic", value:Cubic},
,{label:"Quadratic", value:Quadratic},
, .... etc ];
Then bind directly to the currently selected item's value.
Peter
On Nov 25, 2007 6:57 PM, Amy <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> --- In [email protected], "Peter Hall" <[EMAIL PROTECTED]> wrote:
> >
> > easingEffect is a style and you can't bind to styles. Instead, you
> > must use setStyle("easingEffect", newValue), whenever you want to
> > update it.
>
> That is an interesting answer, but what I am looking for is how you'd
> populate that newValue parameter based on what someone clicks in a
> list. For instance, I don't think setStyle("easingEffect",
> mx.Effects.easing.[thePackage].easeInOut) would work. What would?
>
> Thanks;
>
> Amy
>
>