Preloader causing variable problems

Hi,

I have a movie that works as a fashion photo colection, it has a photo at the left and a grid that when we click on it makes the photo move and give room to the next, it uses a few variables.
The problem is, if i put a preloader on the flash, it doesnt work anymore, if i remove the preloader scene, it works, how can that be??
Does having scenes ruin variables?
The movie only has two scenes, the preloader is basic and shouldnt interfere with the rest of the movie, right? what could be wrong?
In fact, the preloader is from this site, from david, i think.
Would appreciate some help, thanks.

How can i check the variables states/values live while running the movie? Flash has a debug option that lists variables, but its not live.

what is the script on your preloader?

_root.brian

the code is simply this:

totalK = Math.floor(getBytesTotal() / 1024);
loadedK = Math.floor(getBytesLoaded() / 1024);
remainingK = totalK - loadedK;
percentageK = Math.floor((loadedK / totalK) * 100);
if ((getBytesLoaded()/1024)>=(getBytesTotal()/1024)&&(getBytesTotal()/1024)!=0){
gotoAndPlay (3);
}

I’ll start off by saying, I have no idea what is wrong with the code you posted. It seems right to me.

However, here what I do when In a “variable jam”.

I just create some dynamic boxes somewhere on the scene and I assign them the appropriate variable names. That way, it is LIVE and it helps a great deal when you’re not quite sure what is being loaded and what is not.

Good Luck!

hue… Tracing the variable is easier, Inigo… trace (variable), simply.

pom :asian:

Use that its quite good but its configured to the normal stage sizes

if (!zInit) {
createEmptyMovieClip(“mcBorders”, 2);
createEmptyMovieClip(“mcProgress”, 1);
mcBorders.lineStyle(2, 0x0000ff, 100);
mcBorders.moveTo(25, 180);
mcBorders.lineTo(25, 220);
mcBorders.moveTo(525, 180);
mcBorders.lineTo(525, 220);
mcBorders.zInit = true;
}
_root.nPercentLoaded = (_root.getBytesLoaded()/_root.getBytesTotal())100;
_root.nXround = (Math.ceil(nPercentLoaded/20))20;
mcProgress.beginFill(0xff0000,100);
mcProgress.moveTo(25, 190);
mcProgress.lineTo((nPercentLoaded
5)+25, 190);
mcProgress.lineTo((nPercentLoaded
5)+25, 210);
mcProgress.lineTo(25, 210);
mcProgress.endFill();
if (_root.nPercentLoaded<100) {
gotoAndPlay(_currentframe-1);
} else {
removeMovieClip(_root.mcBorders);
removeMovieClip(_root.mcProgress);
}