actually I am not sure if it is possible with Stage3D to render the depth buffer directly. I briefly searched for it myself, but didnt come up with any answers. Maybe Jason Huang can help you with it. He already did this.
But there is a workaround that may help you. You can write a simple shader, which calculates the distance between the camera and the fragment(pixel) and outputs this as a grey value. This shader must be applied to all objects in the scene.
Now you would have to find a way to somehow "assign" this material to a second camera. I dont know if it is possible to render the scene with two cameras with different materials on the objects.
But if its possible you could render that camera to texture and - voila! - you have your shadow map
Hope this helps.