If I understand correctly, you are seeing white pixels around the shadow that you created when you output the PNG. Here’s what you need to do:
Once you have flattened the image with shadow on a transparent layer, select all (cnd-a), hold down the command key and tap the left arrow. This will isolate the pixels in the image. Release the command key and tap the right arrow to return the art to its original position. Now go to the layer menu and select Matting > remove white matte. This will clear out the unwanted pixels. You can try the other settings as well.
When you output the PNG, use Output for Web and select PNG 24. This should take care of the problem.