# After last pic of xml do an action

**URL:** <https://forum.kirupa.com/t/after-last-pic-of-xml-do-an-action/269709>\
**Category:** flash\
**Created:** [August 31, 2008, 7:24am UTC](https://forum.kirupa.com/t/after-last-pic-of-xml-do-an-action/269709 "2008-08-31T07:24:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [August 31, 2008, 7:24am UTC](https://forum.kirupa.com/t/after-last-pic-of-xml-do-an-action/269709/1 "2008-08-31T07:24:12Z")

</div>

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.

```auto
addEventListener(Event.ENTER_FRAME,tracePic);

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

```
