# Using onEnterFrame to monitor Captivate SWF progress

**URL:** <https://forum.kirupa.com/t/using-onenterframe-to-monitor-captivate-swf-progress/184700>\
**Category:** Uncategorized\
**Created:** [April 6, 2006, 10:40pm UTC](https://forum.kirupa.com/t/using-onenterframe-to-monitor-captivate-swf-progress/184700 "2006-04-06T22:40:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philip73](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/philip73/32/2266_2.png) [@philip73](https://forum.kirupa.com/u/philip73)\
**Post date:** [April 6, 2006, 10:40pm UTC](https://forum.kirupa.com/t/using-onenterframe-to-monitor-captivate-swf-progress/184700/1 "2006-04-06T22:40:33Z")

</div>

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! 🙂

- philip

```auto
 
//-- 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);

```
