Last I checked, both .png and .jpg dont support alpha channels. You could use the ming flash extension however to import a .jpg or .png to flash, add your alpha layer there (you can hide that layer by toggling visibility), then output it in .swf
I could be wrong tho on the alpha channels, but I dont think you could do it with gd or gd2