To do it I adapted the code from this tutorial: http://dev.tutsplus.com/tutorials/building-a-dynamic-shadow-casting-engine-in-as3-active-premium--active-8317
I ported it to bitmaps, optimised it a lot, removed the blur and optimised it again. So, the concept of how it works is the same, but the implementation is completely different. I’ll try to find if I still have the source if someone’s interested.