# \_currentframe from loaded swf movieclip return main timeline's frame

**URL:** https://forum.kirupa.com/t/-currentframe-from-loaded-swf-movieclip-return-main-timelines-frame/279105
**Category:** flash
**Created:** [January 9, 2009, 3:03pm UTC](https://forum.kirupa.com/t/-currentframe-from-loaded-swf-movieclip-return-main-timelines-frame/279105 "2009-01-09T15:03:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sag](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Sag](https://forum.kirupa.com/u/Sag)
#### Post date: [January 9, 2009, 3:03pm UTC](https://forum.kirupa.com/t/-currentframe-from-loaded-swf-movieclip-return-main-timelines-frame/279105/1 "2009-01-09T15:03:38Z")

</div>

Hello all,

I am a new user in this forum, but have used it alot for actionscript help.

I’ve google’d for this problem alot and yet found the solution.

My script have a list of .swf files and needs to play them one by one. My problem is that i can’t detect when the movieclip (containing the swf) completes playing.

I understood that i need to copmare between \_currentframe and \_totalframes of the moviecip but i keep getting 1 as the \_currentframe (my main timeline contains only 1 frame).

```auto
var mcLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
var container:MovieClip = this.createEmptyMovieClip("container",getNextHighestDepths());
loadListener.onLoadInit = function(target_mc:MovieClip) {
  target_mc.onEnterFrame = function(){
    trace(this._currentframe);
 }; 
};
mcLoader.addListener(loadListener);
 
mcLoader.loadClip("file.swf", "container");

```

- This code is attached to the only keyframe i have on the main timeline.

When executing the code, the onEnterFrame seems to work because i get a lot of trace lines. but them all say “1”.

Thank you,

Sag
