_currentframe from loaded swf movieclip return main timeline's frame

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).

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