views:

600

answers:

0

Hey guys, I am using both Flowplayer and Jquery Tools Overlay. I have my overlay to display when they click a link. The overlay displays correctly and the video auto-starts as it should but when it ends, I was trying to call the overlay's close function to close it out. Here is my div for the overlay.

<script> 
    var player = $f("player", "images/flowplayer-3.1.5.swf",  { 

        // default configuration for a clip 
        clip: conf.defaults

    });

</script>

This is using a config js file that I set here:

var conf = {

 // default clip configuration
 defaults: {

  autoPlay: true,
  autoBuffering: true,

  // functions are also supported
  onBegin: function() {

   // make controlbar visible in 4000 seconds
   this.getControls().fadeIn(4000);
  },

  onFinish: function() {        // set an event handler in the configuration 
         var b = $("#movie").overlay({oneInstance: false, api: true});
   b.close();
   this.unload();
     }, 

 }
}

The problem is when the video ends, it creates the variable "b" but the close function does nothing. I checked in firebug and the variable has the close function open to it. Is there perhaps another way to forcefully close an overlay on it's own?