Answered
preloader never stop hiting when it achive the percentage i want
it´s pretty simple, i have a preloader witch hits a
certain function when it gets to the percentage
but the problems is that i have to make it just ONE hit per function, and it keeps hitting without stoping
here´s the preloader:
preloader_mc.onEnterFrame = function () {
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
pct = (loaded/total) * 100;
pct = Math.floor(pct);
//HERE´s the whole problem:
if (pct >= 10 and pct < 30) {
loadlogo01 ();
}
if (pct >= 30 and pct < 50) {
loadlogo02 ();
}
if (pct >= 50 and pct < 70) {
loadlogo03 ();
}
if (pct >= 70 and pct < 90) {
loadlogo04 ();
}
if (pct >= 90) {
loadlogo05 ();
}
if (pct == 100) {
_root.gotoAndStop(2);
preloader_mc.unloadMovie();
}
}
so, it´s basically this:
for ex:
if (pct >= 70 and pct < 90) {
loadlogo04 ();
}
in this part of the code, the "loadlogo04 ();" function is supposed to just be called ONE time, but it´s calling several time whenever "pct >= 70 and pct < 90".
i want ALL functions to be called once.
but the problems is that i have to make it just ONE hit per function, and it keeps hitting without stoping
here´s the preloader:
preloader_mc.onEnterFrame = function () {
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
pct = (loaded/total) * 100;
pct = Math.floor(pct);
//HERE´s the whole problem:
if (pct >= 10 and pct < 30) {
loadlogo01 ();
}
if (pct >= 30 and pct < 50) {
loadlogo02 ();
}
if (pct >= 50 and pct < 70) {
loadlogo03 ();
}
if (pct >= 70 and pct < 90) {
loadlogo04 ();
}
if (pct >= 90) {
loadlogo05 ();
}
if (pct == 100) {
_root.gotoAndStop(2);
preloader_mc.unloadMovie();
}
}
so, it´s basically this:
for ex:
if (pct >= 70 and pct < 90) {
loadlogo04 ();
}
in this part of the code, the "loadlogo04 ();" function is supposed to just be called ONE time, but it´s calling several time whenever "pct >= 70 and pct < 90".
i want ALL functions to be called once.
