;

PDA

Click to See Complete Forum and Search --> : getBytesLoaded and Total


3DH
06-07-2008, 09:47 AM
Hi,

I wanna use thise simple scrpt:

if (someLoader.getBytesLoaded >= someLoader.getBytesTotal) {
element ("Button").show(); {
} else {
element ("Button").hide();
}

But it doesn't work :rolleyes:

LewxX²
06-07-2008, 10:35 AM
You've made a little mistake:

if (someLoader.getBytesLoaded >= someLoader.getBytesTotal) {
element ("Button").show(); {
} else {
element ("Button").hide();
}

Zoranan
06-07-2008, 10:57 AM
it doesn't usually make a difference, bit try putting () at the end of getBytesTotal and getBytesLoaded. Also, get rid of the extra {

if (someLoader.getBytesLoaded() >= someLoader.getBytesTotal()) {
element ("Button").show(); {
} else {
element ("Button").hide();
}

3DH
06-07-2008, 11:05 AM
I try do that, but still doesn't work. Meybe attach file help my with this problem. Plz check this file.

---

I need that script for simple gallery (for my friend). I wanna make 30 small picture, and load these images from server, using "Loader" from 3DFA. But in one time, you can see max 15 small picture. For next 15 pictures, must use button 'next page'. And now i got a problem with this button, becose if my friend put only 15 images, then i don't need that button. So, i can hide it. But if he put image nbr. 16, then i wanna show this button, to check next images.

Btw. Here is my prototype gallery:
http://photo-passion.galtim.pl/galeria/

Leo Cavalcante
06-07-2008, 03:45 PM
I guess that I make what you are looking for.
Can you programming using the progress script of loaders
Take a look!

3DH
06-07-2008, 04:01 PM
Thx again Leo :D

3DH
06-07-2008, 04:12 PM
This work, but it's very, hm, heavy for processor. That why i don't use this preloaders :(

Leo Cavalcante
06-07-2008, 04:51 PM
I'm not sure but, is this?!

3DH
06-07-2008, 05:29 PM
Unfortunately no. For explane. When i activate progress bar, then i use 80% my processor. And this is only one photo and button! So, if i try use this on normal website, then my web browser crash.

Btw. When i turn off this progress bar, then i use only 7% my processor.

Btw2. mr. Kusko, when you do somthing with that bar??

Zoranan
06-09-2008, 08:10 PM
That is pretty weird...

Zoranan

3DH
06-09-2008, 08:33 PM
Maybe progress script is wrong? Maybe this script doesn't stop (or delete) when finish loading some file, and that why use more processor? I don't know.

Zoranan
06-09-2008, 08:42 PM
try taking your existing progress script, and adding this if statement to it

if (some_loader.getBytesLoaded() < some_loader.getBytesTotal()){
//the rest of your progress bar script
}

Zoranan