Urgent help needed!

Hi, everyone!
I’ve got a few days to figure out how to make one .swf to control another .swf, when one stops on the last keyframe the another starts playing from frame 1 and so on.

Thanks for any advice,