I am working on a menu system for my website and I am having trouble going from the loader to the menu. When I run the loader it crashes in flash. And when I run the debugger it appears to work, but runs the whole loader even if the movie has been downloaded. Instead of going to the menu as soon as it has downloaded. Heres my code. thanxs for the help
-ATray
//create loop that goes through frames until file has been //downloaded
stop();
var complete:Boolean = false;
i=1; //frame 1
totalFileSize = _root.getBytesTotal();
while(!complete) {
trace(complete);
trace(i);
// see how much has been loaded so far
bytesLoaded = _root.getBytesLoaded();
// convert to a value from 0 to 1
amountLoaded = bytesLoaded/totalFileSize;
// convert to a value from 0 to 100
percentLoaded = int(100*amountLoaded);
if (i==39)
i = 1;
i = i + 1;
if (amountLoaded >= 1.0) {
trace("finished");
percent.text = percentLoaded + "%";
complete = true;
}
percent.text = percentLoaded + "%";
trace(i);
gotoAndPlay(i);
}
gotoAndPlay("Light", 1);
-ATray
//create loop that goes through frames until file has been //downloaded
stop();
var complete:Boolean = false;
i=1; //frame 1
totalFileSize = _root.getBytesTotal();
while(!complete) {
trace(complete);
trace(i);
// see how much has been loaded so far
bytesLoaded = _root.getBytesLoaded();
// convert to a value from 0 to 1
amountLoaded = bytesLoaded/totalFileSize;
// convert to a value from 0 to 100
percentLoaded = int(100*amountLoaded);
if (i==39)
i = 1;
i = i + 1;
if (amountLoaded >= 1.0) {
trace("finished");
percent.text = percentLoaded + "%";
complete = true;
}
percent.text = percentLoaded + "%";
trace(i);
gotoAndPlay(i);
}
gotoAndPlay("Light", 1);