I'm trying to use AS3_Shim in my alchemy code but it doesn't seem to be working. It always returns a NULL function pointer. There don't seem to be any examples of AS3_Shim's use, so I'm not sure what I'm doing wrong. Here is some example code:
static AS3_Val thunk_logtest(void *self, AS3_Val args) {
// warning: this leaks
AS3_Val ns= AS3_String("mx.logging");
AS3_Val clazz= AS3_NSGetS(ns, "Log");
AS3_Val logger= AS3_CallTS("getLogger", clazz, "StrType", "alchemy");
// works
AS3_Val logret= AS3_CallTS("debug", logger, "StrType", "this is a test");
// doesn't work: AS3_Shim returns NULL!
typedef void (*log_func_t)(const char[], ...);
log_func_t log_func= (log_func_t)AS3_Shim(AS3_String("debug"), logger, "VoidType", "StrType", true);
printf("log_func= %d \n", log_func); fflush(stdout);
// because log_func is NULL, this throws TypeError: Error #1006: value is not a function
log_func("this is a test");
return AS3_Undefined();
}