Hello,

I need to dynamically get a reference of a Class and I'm not able to do so.

I think an example will illustrate my point better:

----------------------------------------------------------------------------------------
package com.zefxis.solarwind2.animations {

import fl.motion.easing.*;

public class EaseFunctions {

private var _easeClassName:String;
private var _easeFuncName:String;

private static var easeDependencies = [Back,
            Bounce,
            Elastic,
            Linear,
            Cubic,
            Quadratic,
            Circular,
            Exponential,
            Sine,
            Quintic,
            Quartic];

public function EaseFunctions() {
}

public function getEasingFunction(functionName:String):Function {
 var tmp:Array = functionName.split(".");
 this._easeClassName = tmp[0];
 this._easeFuncName = tmp[1];

 //trace(this._easeClassName, this._easeFuncName);
var easeFunc:Function = fl.motion.easing[this._easeClassName]["easeIn"]; // ************************


 return easeFunc;
}
}

}
----------------------------------------------------------------------------------------

What I want to do is pass a parameter like "Cubic.easeIn" so that EaseFunctions parses that into Cubic.easeIn. The code above produces a compile error: "1120: Access of undefined property fl.". Any clues?
(it used to work in AS2)

Thank you,

Dimitrios



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to