Friends methods / classes for unpacked AS3 classes
Hey. I am wondering if I can have an AS3 batch () class for a private method for the main class in a file. For example:
package demo
{
public class MyDemoClass
{
var helper:FriendlyHelperClass = new FriendlyHelperClass(this)
}
private function methodToCall():void
{
...
}
}
public class FriendlyHelperClass
{
public function FriendlyHelperClass(demo:MyDemoClass)
{
demo.methodToCall()
}
}
Calling the ToCall () method from the FriendlyHelperClass will fail because it is a private member of MyDemoClass. Is there a way to call methodToCall () from the FriendlyHelperClass without extending MyDemoClass.
Basically I'm looking for inner class functionality that Java or some kind of C ++ style friends class has.
+2
source to share
3 answers