Flash Panorama

I’m looking for a tutorial to build my own panoramic image viewer in flash complete with image distortion. I’m not talking about just panning an image. I’m talking about something that distorts the image near the sides in order to create a realistic 3d effect. There are plenty of standalone apps out there for $70 and up, but I’m looking for some instruction to build one myself. Thanks!