hey,
Im not the best when it comes to actionscript, but there is one thing thats been bugging me with what im currently trying to do…
I have a few .as classes that i am importing into my current flash project, but ive got a couple of asynchronous functions that i could do with being more generic…
An example would be:
public function setupResponder()
{
var responder:Responder = new Responder(onSuccess, onFailure);
...
}
Now that would always route a SUCCESS and FAILURE scenario to the relevent functions, but i could do with a way of making it redirect to various other functions depending on the flash project im using… so this would be an exaple of what i want to do:
public function setupResponder(SuccessFunction, FailedFunction)
{
var responder:Responder = new Responder(SuccessFunction, FailedFunction);
...
}
However im not entirely sure if this is ok to do…
A) Can you pass functions over as arguments in flash?
B) The functions will be out of scope, so would i have to do myProject.SuccessFunction?
Im hoping im not asking something crazy, any advice on this would be great!