Problems with ExternalInterface.addCallback in IE

This is so frustrating…I’m going to do my best to be concise here, so forgive me if I leave too much out. I’m also going to try to simplify so I don’t get bogged in details.

I have a set of html pages that guide you through a tutorial. The different pages are REALLY just one big page that has divs hide and unhide as you go through the flow via previous and next buttons.

There are 4 pages which play a video clip. Each video clip .swf contains an FLVPlayback component that plays an .flv, and uses an .swf skin file. All these things play fine.

If you’re watching a video and you click “NEXT” the sound is still playing because of course you’re still on the same page. So we looked into it and found out about the whole ExternalInterface.addCallback thing.

Now…On a local server, using absolute paths to the FLV (that is on a live server) (although path to the skin .swf won’t show up unless I use a path the the local version, but that’s a separate issue) the thing works great. You hit “next”, the audio stops, movie is paused. yay.

Upload that same setup to live, it keeps playing. I’m pulling my hair out.

Differences in the two environments:

  1. LOCAL: html page, javascript, swfs, all on the local server (FLV is pulling from live)
  2. LIVE ENVIRONMENT: html page is on (using fake urls here) BLAH.server.com, graphics are on “WWW.server.com” which are then being akamai-zed. The “server.com” is the same, although the akamai url is like “http://something.akamai.server.com

the actionscript that appears in it’s own layer on frame one:


var movie:mx.video.FLVPlayback;

import flash.external.ExternalInterface;  
ExternalInterface.addCallback("pauseMovie", this, pauseMovie);  
function pauseMovie(){
movie.pause();
}


The Javascript that appears in a .js file linked within the body of the html page:


/**
 * This function loops through all of the pages that have flash movies and tries
 * to pause the movies unless it's on the current page.  This can be called at
 * any time to pause all movies that aren't on the current page.
 **/
function gsPauseFlash ( ) {
  var currentPageName = gsPages[gsCurrentPage-1];
  for( var i = 0; i < gsMoviePages.length; i ++ ) {
    if( gsMoviePages* != currentPageName ) {
      var movie = gsGetFlashMovieObject( gsMoviePages* + '_movie' );
      if( movie != null ) {
        try {
          movie.pauseMovie( );
        }
        catch( e ) {
        }
      }
    }
  }
}


Each of the FLVPlayback instances have the instance name “movie”

Please…please help me. I’m going NUTS.

Let me know if I need to add (or indeed, cull) any of this information to make it clearer.

Rick