After last pic of xml do an action

I’m trying to trigger an action at the time frame after the last picture in the xml file is loaded.

  1. I was thinking can I add a line of code in the end of the xml list with actionscript3? (like gotoAndPlay kind of script)

  2. Or I’m trying to trace at which number of pic the flash is currently running till.

addEventListener(Event.ENTER_FRAME,tracePic);

function tracePic(event:Event) {
    if (current pic == last pic of xml) {
        trace("end");
    }
}