I’m looking for a peice of actionscript which will give me a load-bar preloader for an externally loaded .swf file. I’m not great with actionscript (though not totally out of it.) and am currently using the :
if (_framesloaded>=_totalframes) {
gotoAndPlay(3);
} else {
gotoAndPlay(1);
}
approach, which doesn’t give me a loadbar. When I tried to use the loadbar like this:
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent100;
_root.loadText = Math.round(getPercent100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}
(and with a “gotoAndPlay(1);” in the next frame)
it failed to work for both the regular movies within MX 2004 as well as the externally loaded ones. I know there’s an easy fix here…I just don’t know what it is.