For reasons I am generating a class at runtime which has an existing super class with a protected member and implements an existing interface. Each method (and accessor) of the interface needs to get generated, too. The point where I'm struggeling is to fill the method body with the correct opcodes. Here is an example which i want to generate or translate into opcode:
public function myFunction(arg1:String, arg2:int):Boolean
{
return member.my_namespace::myFunction(arg1, arg2);
}
All Informations are available, like the name of the function, the arguments, the return type and the namespace. And I am able to create the function itself and return a default value, like seen in the as3commons tests/examples
Maybe I should use another lib than as3commons?
I found the answer by myself. All I was missing was the (correct) using of the QualifiedName to have access to the member and the function of it. I removed just the namespace. That is all I modified at the template code:
Here is the needed sourcecode to generate that function inclusive the Opcodes for the method body:
I give no garanty that the code works. I adjusted it with some dynamically stuff and loops in my own project where it works very well. The libs I use(d) are:
All available under the as3commons downloads