Adding preroll-ad swf to flv player


I need to insert a preroll ad by importing an swf file defined by my ad server. The ad is loaded into frame one, and my .flv file is loaded into frame two. Currently, when the ad loads and plays, it just loops indefinitely and frame two is never reached. I need to be notified when the imported swf file has reached it’s end so that I can advance the main timeline from frame one to frame two. Anyone know how this type of check is accomplished?