DevlogsDevlogs
Just a quick note, without any clarification. The question is, how to call method that was overridden in Action Script code. Suppose Our object exposes to Action Script public method 'execute'. When You override this method Your additional code will not be executed.
Code below can be used to extract 'execute' method code from virtual methods table. Call is this way - additional code (from overridden function) is also included.
I don't know if this is the best solution :)
//AMV+ core object
AvmCore *core = thread->core();
Atom ret;
// method that we want to call is 'execute' and it
//can be overridden by AS programmer
Stringp name = core->internString(core->newConstantStringLatin1("execute") );
Binding bind = myInstance->traits()->getTraitsBindings()->findBinding( name );
if ( bind ){
//get method from vtable
MethodEnv *method = myInstance->vtable->methods[AvmCore::bindingToMethodId(bind)];
Atom atomv_out[1] = { myInstance->atom() };
//execute mothod's code
ret = method->coerceEnter( 0, atomv_out );
};
No comments as yet. Be first to comment.