There was another question, how to add a function to an array, or why is the function in the array empty?
Wrote function:
private function subscribeToCallback(name:String, func:Object) : void { callbacks[name] = {'callback': func}; } Next, in the class constructor, I call a function with parameters:
subscribeToCallback("sConn", function():void { trace("sConn"); }); And actually further in 2-5 seconds I try to get the data from the array, which I declared after creating the class:
public var callbacks:Array = new Array(); I try to get this way:
trace(callbacks["sConn"].callback); And in response, I get in the console:
function Function() {} Why is it empty? How can I thrust a function into an array?