Changing Variable (dataType Function) with a comboBox

Platform : Flash CS3, AS3

Hi, I hope this will be an easy problem for some of you.

I have a variable (easeType) sat in a Class called dragClip
it’s set within the class like so;

public var easeType:Function = Elastic.easeOut;

this variable changes the type of easing of the class when it uses a tweening method.

I want to use a comboBox on the Stage to change the value of this variable, so that the class eases in the way specified by the comboBox. I have it populated with options like Bounce.easeOut and Strong.easeOut

On the timeline, I have this code;


function changeHandler(e:Event):void {
    var cb:ComboBox = e.currentTarget as ComboBox;
    var fn:Function = getDefinitionByName(cb.selectedLabel] as Function ;   
    dragClip.easeType = fn;
}
 
easePicker.addEventListener(Event.CHANGE, changeHandler);

Unfortunately, when I select anything in the comboBox, I get this error;

ReferenceError: Error #1065: Variable easeOut is not defined.
at global/flash.utils::getDefinitionByName()

I assume the problem is because of the dot between (for example) Strong and easeOut but I don’t really know where to go from here.

Ok, I have a work around now, which gives the desired effect but is not ideal. So if anyone has the proper solution, please contribute too.


 
import fl.transitions.easing.*;
 
var easeArray = new Array(Elastic.easeOut,Regular.easeOut,Strong.easeOut,Bounce.easeOut,Back.easeOut)

function changeHandler(e:Event):void {
    var cb:ComboBox = e.currentTarget as ComboBox;
    var sel:uint = cb.selectedIndex;
    dragClip.easeType = easeArray[sel]; 
}
 

The fact is that the array is a repetition of the data in the comboBox, so it’s a bit redundant. It works, though.