Hi there, I'm using the Delegate class and can't figure out how to
call methods of another class.
I think there is an easy answer to this, any suggestions whole-
heartedly appreciated.
Thanks,
Ali
Here is the syntax I'm using:
import Thermometer
class Animator{
var therno:Thermometer
function Animator(){
thermo = _global.timeline.thermometer;
}
private function startNextQ():Void {
Delegate.create(thermo, allowInteraction) // error: There is no
property with the name 'allowInteraction'.
thermo.allowInteraction(true); //doesn't work }
}
}
///////
btw I don't know if you guys are already aware of this but I came
across a neat way to pass vars using Delegate from this blog http://animateinexile.blogspot.com/2008/01/i-delegate-class-caller.html
//import the Delegate class
import mx.utils.Delegate;
//add a variable to pass to your handler
something.onPress = Delegate.create(this, someHandler);
something.onPress.myVariable = "pass me";
//now to access that variable use caller
function someHandler(){
var passedVar= arguments.caller.myVariable;
trace(passedVar);
}
thanks to luftbuefel for that!
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders