Swf works fine - won't play when placed on HTML page. Thoughts?

I’ve got my swf which plays fine when opened in a browser - it’s a container called ‘country’ that’s coded to load the different clips (clip1.swf, clip2.swf, etc.) - but when placing it into an HTML page it won’t load the clips and I’m thinking it’s because of some actionscript error.

I didn’t code this and can’t get my original designer so was looking for any guidance.

Here’s the swf playing fine: http://dev.traveller.org/india/flash/country.swf

Here’s the HTML page that doesn’t work: http://dev.traveller.org/india/

Scripts are all loaded on the server in the /Scripts/ folder

Below is the ActionScript from the country.swf container that loads the clips. Any ideas on what I’m doing wrong to get it to load on the HTML page?

  • Bradley

function _playClip(fileName)
{
var clipName = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.indexOf(".")) + “_mc”;
if (_root[clipName] == undefined)
{
if (loadingMovie != null)
{
mcLoader.unloadClip(loadingMovie);
delete loadingMovie.onEnterFrame;
removeMovieClip (loadingMovie);
trace (loadingMovie);
loadingMovie = null;
} // end if
_loadClip(fileName);
} // end if
this.onEnterFrame = function ()
{
var _loc3 = Math.round(_root[clipName].getBytesLoaded() / _root[clipName].getBytesTotal() * 100);
_root[clipName]._visible = true;
if (_loc3 < 100 || isNaN(_loc3))
{
_root.currentMovie.gotoAndStop(105);
}
else
{
trace (clipName + " != " + _root.currentMovie._name);
if (clipName != _root.currentMovie._name)
{
if (_root[clipName].getDepth() < _root.currentMovie.getDepth())
{
_root[clipName].swapDepths(_root.currentMovie.getDepth());
} // end if
_root.currentMovie.gotoAndPlay(116);
_root[clipName].gotoAndPlay(3);
}
else
{
_root[clipName].gotoAndPlay(13);
} // end else if
_root.currentMovie = _root[clipName];
delete this.onEnterFrame;
} // end else if
};
} // End of the function
function _loadClip(fileName)
{
var clipName = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.indexOf(".")) + “_mc”;
var _loc3 = Math.round(_root[clipName].getBytesLoaded() / _root[clipName].getBytesTotal() * 100);
if (_root[clipName] && _loc3 == 100)
{
return;
} // end if
var _loc4 = _root.createEmptyMovieClip(clipName, nextDepth);
++nextDepth;
mclListener.onLoadStart = function (target_mc)
{
loadingMovie = _root[clipName];
if (_root.currentMovie != null)
{
target_mc._visible = false;
target_mc.gotoAndPlay(1);
} // end if
};
mclListener.onLoadComplete = function (target_mc)
{
if (_root.currentMovie != null)
{
if (_root.currentMovie._name != target_mc._name)
{
target_mc.stop();
} // end if
}
else
{
_root.currentMovie = target_mc;
} // end else if
loadingMovie = null;
};
mcLoader.addListener(mclListener);
mcLoader.loadClip(fileName, _root[clipName]);
} // End of the function
var home;
var currentMovie = null;
var loadingMovie = null;
var previousMovie = null;
var mclListener = new Object();
var mcLoader = new MovieClipLoader();
if (home == undefined)
{
home = “”;
} // end if
var nextDepth = 1;
_loadClip(home + “clip1.swf”);
stop ();