I am returning to an object after a custom event-
the custom event has a property in it called “aFunctionName”
which is the name of a function I wish to run if this particular object,
or any others that catch this event, should run if they have it.
The code below works, but only if the function to run is “public”
ActionScript Code:
//
public function doAfterTheEvent(e:CustomEvent)
{
if (this.hasOwnProperty(e.aFunctionName))
{
thise.aFunctionName;
}
}
//e.aFunctionName = “theFunctionToRun”
public function theFunctionToRun()
{
// blah blah
}
if it is private, it does not work:
ActionScript Code:
//
private function theFunctionToRun()
{
// blah blah
}
Any solutions?
I could run it with
ActionScript Code:
//
try
{
thise.theFunction;
}
catch(errObject:Error)
{
// do nothing…
}
but I am afraid this would not be a good practice, as many classes/objects would be, in essence, erroring out.
Or is this an accepatble way of handling this?
Thanks!