# Show % loaded?

**URL:** <https://forum.kirupa.com/t/show-loaded/111437>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 9:55pm UTC](https://forum.kirupa.com/t/show-loaded/111437 "2004-05-26T21:55:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![danulf](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danulf/32/555_2.png) [@danulf](https://forum.kirupa.com/u/danulf)\
**Post date:** [May 26, 2004, 9:55pm UTC](https://forum.kirupa.com/t/show-loaded/111437/1 "2004-05-26T21:55:54Z")

</div>

I have made this loadthing that only shows the progress in percent,  
but I only see 99% and 100%!  
I’m not good at explaining, but I hope you get it 😉

Here’s what I have done:

I have 3 keyframes, and in the third I have the clip itself with a stop(); actionscript.

In the first frame i have a dynamic text square that has the instant name ‘myOutput’.  
The actionscript for that frame is:  
percent = Math.floor(getBytesLoaded()/getBytesTotal()\*100);  
myOutput.text = percent + “% is loaded”;

In the second frame I just copied the text square, but I changed the actionscript to:  
if (percent == 100){  
gotoAndStop(3);  
}else{  
gotoAndPlay(1);  
}

What did I do wrong? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 10:31pm UTC](https://forum.kirupa.com/t/show-loaded/111437/2 "2004-05-26T22:31:37Z")

</div>

is it getting to the third frame?

Prophet.

PS i just use the code in the kirupa tutorial… obviously i tweak it wen i need to but it works so i use it. simple.

EDIT:- wats the “math.floor” bit? wuldnt u rather round it? ive no idea wat flooring it does (in a mathmatical sense) but if its not gettin to the third frame id say its coz its reached a number which is just lower than 100 and therfore isnt a true %age value, hence its not meeting the final condition.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 10:49pm UTC](https://forum.kirupa.com/t/show-loaded/111437/3 "2004-05-26T22:49:54Z")

</div>

this on the first frame will give a truly bare bottom loader:

//setup variables for movie check  
totalNum= \_root.getBytesTotal();  
loadedNum= \_root.getBytesLoaded();

//calculate percentage loaded  
percentage= loadedNum/totalNum\*100;

//dynamic text box with instance name percentLoaded displays calculated value +"% Loaded"  
percentLoaded.text= percentage + “% Loaded”;

if(loadedNum=totalNum){  
gotoAndPlay(“3”)  
}  
else {play();  
}

this is assuming you have a clip or something else on frame 3.

sam

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 26, 2004, 10:50pm UTC](https://forum.kirupa.com/t/show-loaded/111437/4 "2004-05-26T22:50:16Z")

</div>

😛 Floor IS rounding in a sense, it rounds down to nearest integer as opposed to ceil (ceiling) which rounds up. From the flash reference:

> The floor is the closest integer that is less than or equal to the specified number or expression.

The ceiling of a number is the closest integer that is greater than or equal to the number.

:hr:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 12:48pm UTC](https://forum.kirupa.com/t/show-loaded/111437/5 "2004-05-27T12:48:47Z")

</div>

thanks maximum\_flash! I’m gonna try that right now! 😃

EDIT:  
It doesn’t work, but thanks anyway!

EDIT2:  
Haha, it DOES work, i just mixed one thing up! thanks man!

EDIT3:  
the third edit! 😃  
This has the same problem,  
it’s blank, blank, blank, blank, 100% loaded and then it pops up!  
oh, by the way: Yes prophet, it’s getting to the third frame.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 3:25pm UTC](https://forum.kirupa.com/t/show-loaded/111437/6 "2004-05-27T15:25:50Z")

</div>

There’s probably alot of stuff in the first frame, hit ctrl+B to check;)

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 3:29pm UTC](https://forum.kirupa.com/t/show-loaded/111437/7 "2004-05-27T15:29:42Z")

</div>

> [@scotty](#):
>
> There’s probably alot of stuff in the first frame, hit ctrl+B to check;)
> 
> scotty(-:

even if that was the case (but it’s not :ogre: ), the loader would work right?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 3:35pm UTC](https://forum.kirupa.com/t/show-loaded/111437/8 "2004-05-27T15:35:24Z")

</div>

Post your fla:)

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 4:20pm UTC](https://forum.kirupa.com/t/show-loaded/111437/9 "2004-05-27T16:20:06Z")

</div>

ok… The attachment thing isn’t working for me, so i made a freewebs thing 😃

[www.freewebs.com/dazov/about\_me.fla](http://www.freewebs.com/dazov/about_me.fla)

Btw! how do i make a scrollable text thing?  
(so i can have more text about me on this page).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 5:36pm UTC](https://forum.kirupa.com/t/show-loaded/111437/10 "2004-05-27T17:36:59Z")

</div>

3 meg?? bloody hell i aint downloadin that!  
wats on it?? i thout it was just a preloader?  
blimey guvnor!!

Prophet.

PS ok this mite sound stupid but it mite be getting to 100% and imediately switchin to frame 3 before you see it. hav u got a dynamic text box on frame 3 to see if it actually gets to 100? coz if ur rounding it and your using the variable value then it mite be switchin too fast weras if u use getBytesLoaded() == getBytesTotal() then it should round to 100 before it actually gets there… try it, hav a look, u never know 😉  
PPS im on 56 k - y i aint downloadin it!! 😉  
PPPS uno thers a tutorials section with this stuff in right? its got about the “scrollable text thing” in ther… (basic version neway)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 6:37pm UTC](https://forum.kirupa.com/t/show-loaded/111437/11 "2004-05-27T18:37:52Z")

</div>

> even if that was the case (but it’s not ), the loader would work right?

I think I wasn’t clear, when you test your movie hit ctrl+B and you would have seen this [SIZE=1](see attachment)[/SIZE]  
You’re loading almost your complete movie on frame 1(except for 192 B) before the preloader can start working.

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 27, 2004, 8:28pm UTC](https://forum.kirupa.com/t/show-loaded/111437/12 "2004-05-27T20:28:48Z")

</div>

ok, now im lost, how would that affect his % probs?

Prophet.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2004, 7:05am UTC](https://forum.kirupa.com/t/show-loaded/111437/13 "2004-05-28T07:05:44Z")

</div>

> [@Prophet](#):
>
> 3 meg?? bloody hell i aint downloadin that!  
> wats on it?? i thout it was just a preloader?  
> blimey guvnor!!
> 
> Prophet.
> 
> PS ok this mite sound stupid but it mite be getting to 100% and imediately switchin to frame 3 before you see it. hav u got a dynamic text box on frame 3 to see if it actually gets to 100? coz if ur rounding it and your using the variable value then it mite be switchin too fast weras if u use getBytesLoaded() == getBytesTotal() then it should round to 100 before it actually gets there… try it, hav a look, u never know 😉  
> PPS im on 56 k - y i aint downloadin it!! 😉  
> PPPS uno thers a tutorials section with this stuff in right? its got about the “scrollable text thing” in ther… (basic version neway)

yea, the .fla file is like 3 times as big as the .swf file (when i export it).  
And, i see “100% loaded” for like 1/10 of a sec before the actual page shows up, but i’ll have a look ;).

EDIT: and thanks scotty, i’m gonna try that as well!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2004, 3:02pm UTC](https://forum.kirupa.com/t/show-loaded/111437/14 "2004-05-28T15:02:56Z")

</div>

welcome:thumb:
