Image slideshow with embed tags for users

Let’s say I have a dynamic image gallery in flash. How could I get flash (AS3) to generate embed codes for each active image (image in focus)?