I've been attempting to use Alchemy to allocate a chunk of memory in C, and then write a bitmap to the memory (via getPixels) which is I would then be able to modify using my super fast C image processing functions. I've been following the "Memory allocation in C with direct access in Actionscript (FAST!!)" section from here.

The problem is that when I allocate the memory in C, then try to display the image using setImage, all I see is a black box on the screen. The code below shows how I use getPixels to fill the C memory region with my bitmap data, then use setPixels to fill the BitmapData object which is displayed on the screen. Does anyone know what I'm doing wrong here? I've been really stuck on this

ActionScript variables, and event function which runs after my Bitmap is loaded

There is full flash code and C++ code so you should be able to answer all your questions just by reading my post. However, one thing I see about how you're passing your pointer back to flash is:

//return pointer to the location in memory return AS3_Int((int)buffer);

I think should be:

//return pointer to the location in memory return AS3_Ptr(buffer);

You shouldn't be casting your char array as an int and returning it, just use AS3_Ptr(buffer) and that will return the actual memory address as an int to flash. I'm not 100% sure but I think this could be an issue. I use this method also in my code you can find in the link above so you can see the full implementation there. Hope that helps.