Using onEnterFrame to monitor Captivate SWF progress

hi all

simple version:
onEnterFrame + external Flash SWF = working
onEnterFrame + external Captivate SWF = not working

long version:
i’m creating a flash-based interface that loads various external swfs. i’m using the loader component. i have an onEnterFrame script that monitors the loaded swf progress and unloads it when it ends. the code posted below works great when the loaded swf is a Flash swf. however… when a CAPTIVATE swf is loaded, the playback control appears, but otherwise the swf is blank and doesn’t play. the captivate playback control, while visible, doesn’t work.

through extensive commenting-out of code, i narrowed it down to my onEnterFrame script. when onEnterFrame is used with the Captivate swf – even if there is no code inside the onEnterFrame function – the swf doesn’t play properly.

a simplified (but functional) version of my code is posted below. any suggestions? captivate can be a major pain in the rear. :wasted:

thanks! :slight_smile:

  • philip
 
//-- Basic loading code ---
import mx.controls.Loader;
createClassObject(Loader, "media", 400);
media.contentPath = "swf/demo.swf";
media.scaleContent = false;
media._lockroot = true;
//-- end Basic loading ---
 
var endWatch:Object = new Object();
endWatch.complete = function(){
 
 //-- Where it breaks down ---
 media.content.onEnterFrame = function() {
  var current = media.content._currentframe;
  var total = media.content._totalframes;
  
  trace("frame " +current +" of " +total);
  
  if (current == total) {
   delete this.onEnterFrame;
   trace("SWF has ended, unloading SWF.");
   removeMovieClip(media);
  }
 }
}
 
media.addEventListener("complete", endWatch);