Ok ... a preloader

<|Textoxes|>\rbloaded (Bytes Loaded)\rbtotal (Bytes Total)\rbleft (Bytes left)\rbpercent (Bytes Loaded in %percents%)\r<|Actions|>\r<<Frame1>>\r_root.bloaded = getBytesLoaded;\r_root.btotal = totalBytes;\r_root.bleft = btotal-bloaded;\r_root.bpercent = (bloaded/btotal)*100;\rifFrameLoaded(3) {\rgotoAndStop(3)\r}\r\r<<Frame2>>\rgotoAndPlay(1);\r\r------------------------------------------\rAnd when I upload it onto internet It shows me this :rolleyes: !!!\r\rbloaded = “[Type Action]”\rbtotal = " " (nothing)\rbleft = “0”\rbpercent = “NaN”\r--------------These are like typed in the textboxes-----------\rok so… by the way the movie is\rSyko171\rNB! IT IS NOT COMPLETED That’s just A little % of the whole movie so… . . . . .

you forgot the underscores before these two
they should be




:slight_smile: common mistake.

nope…no use
by the way before it was getBytesLoaded
and it was blue
now its _getBytesLoaded
and it’s not blue (it’s black)
but totalBytes/_totalBytes is still the same
It was Black before and is black now…
I uploaded it again with new ationscript (_getBytesLo…)
You can check it, it’s still the same (www.hot.ee/syko171) check it if you want but… well I duno what’s wrong…

:smiley: lol:D Cool I made a Topic that as 2 pages… Cool :smiley: lol:D

Lol… I’m an idiot… I should just post you an FLA. I’m working on one now. I’ll figure this out if it kills me

ok… it was just a couple of syntax errors… no biggie. you were missing a couple of (), and I had inadvertantly given you the wrong info.

this is an example I made with an MP3. It is 2 megs, so only fast connection people should bother to download the whole thing, but it’s large so you can see the preload in action.
for slower connections this is one I did with a peice of artwork. It’s 300k maybe.

this is the source. it’s 300k or so.

Hey thanks for helping me out here. but… hey what was the Ascript for rounding things. I don’t want it to show 76.131312124345% but 76.13%
It was something like Math.round(); or something… I don’t remember exactly…

are Math.round and math.Round the same thing? because I used math.Round and the code didn’t turn blue but it worked. thanks guys. -Brian

they are the same thing… capitals don’t count in flash…

say if u had the variable

tdfIsCool and later on u had TDFIsCool as another variable, it would still be the same thing, flash ignores the capital letters in names.

That is not exactly true. If it’s a flash function, you need to keep the caps as the program requires it. I’ll take a look at the file and see what is up with that command Math.round();

it looks to me like it should be

Ok… so I want it to round a number a…e…
not 13.12646342523
but 13.13
How do I do that
Math.round(…:rolleyes: …)
How to do that???


you’re full of questions. Good one too. I’ll try to find it in a book I’ve got.

(in case you don’t get the joke, Supra is my safty net… handling all these hard questions for me… Though I think if he saw the beginning of this post he’d smack me in the head for all the errors I made. :slight_smile: )

what i ment was it doesnt count if its your own variables…
but he was asking about a function, so its my bad. sorry

Ye I got the joke…
So… how to do it then?
I hope that Supra knows and checks the topic out soon…
I’m gonna make the preloader that it’s not 3.24214214 but 3.24 and not that the numbers are in bytes but megabytes (bLoaded10241024) <–piece a cake:)


Hey tdfwrestling!
That banner is HARD COOL!
I wish I could do something like that…
Is there a lot of actionscript? (…well I guess so).
No big animation (circles just getting bigger and moving) but it gives a COOOL effect!!!

i think i’ve seen better solutions but…

you might multiply it by 100, then round, then divide by 100. you could make it an extension of the Math object

&nbsp &nbsp &nbsp &nbsp num = Math.round(num*n);&nbsp &nbsp &nbsp &nbsp 
&nbsp &nbsp &nbsp &nbsp return(num/n);
  • num* is the number to round and * n* is the number of decimal points, so Math.roundto(3.14159265,10); should return 3.14.

i’m on a non-flashed computer right now so i couldn’t test that code … hope it works. ; )

I made a tester and the script is (Frame 1)

bLoaded = getBytesLoaded();
bTotal = getBytesTotal();
bLeft = (bTotal-bLaoded);
bPercent = (bLoaded/bTotal);
ifFrameLoaded(3) {



ok so there are no rounding action or nothing…
There is something wrong I made some modifications to it on my PC so the script is (Frame1)
(I made the modifications only to bTotal cus that way I can seee it on my PC by removing ifFrameLoaded(); action and adding stop(); action)

bLoaded = getBytesLoaded();
bTotal = getBytesTotal();
bLeft = (bTotal-bLaoded);
bPercent = (bLoaded/bTotal);
bTotal = (bTotal10241024);

I added the line
bTotal = (bTotal10241024);
to make it not bytes but mb
:rolleyes: It Doesn’t Work :rolleyes:
I didn’t test the Math.round action yet cuz first I wanted to get this over with…
It still shows me the BIG and LONG number of BYTES :rolleyes:

any good ideas?

try ((bTotal*1024)*1024)

Sorry… LOL… don’t listen to that. What the hell am I thinking…

I’ll try to plug this in and see what I can make out of it. Sorry for jumping to that redundency.

i got back to a flashed machine a found a few things wrong with the code for rounding.

i defined the method incorrectly, should be:

Math.roundto = function(num,n){
        num = Math.round(num*n);        

and you should make * n* equal 100 to round to the nearest hundreth, not 10 as i said earlier.

shouldn’t you be * dividing* by 1024 to get mb from bytes?