Hi everybody on Kirupa.
I have been experiencing an odd problem with the programming of my website.
I decided to load externally all the pictures on all my galleries since embedding the images into the .swf will (obviously) increase the size of the file.
Now, I was able to make them to load, but the percentage indicator is not working, the pictures take a while to load but… ahmm… I better suggest to see by yourself the error:
http://davirus.mx/gui/arcada.html
(in case you wan`t to see, open any of the first buttons “diseño grafico” or “ilustracion”).
this is the code I am using:
onEnterFrame = function ()
{
startLoading("graphics/design/poster_kinta.jpg");
_root.grupo1.poster_01.infoField.gotoAndStop(1);
_root.grupo1.poster_01.box1.gotoAndStop(1);
};
function startLoading(whichImage)
{
loadMovie(whichImage, _root.grupo1.poster_01.imageLoader);
onEnterFrame = function ()
{
infoLoaded = Math.round(imageLoader.getBytesLoaded());
infoTotal = Math.round(imageLoader.getBytesTotal());
percentage = infoLoaded / infoTotal;
_root.grupo1.poster_01.box1.box2.infoField.text = Math.round(percentage * 100) + "%";
if (infoLoaded == infoTotal)
{
delete onEnterFrame;
this.imageLoader.forceSmoothing = true;
_root.grupo1.poster_01.box1.gotoAndPlay("fadeout");
_root.grupo1.poster_01.mypreview._visible = false;
_root.grupo1.poster_01.box1.box2.infoField.text = "listo";
}
};
}
Here is a screenshot of the structure of each button: