PDA

Volledige versie bekijken : Preloader die procenten aangeeft


royboy
%Europe/Berlin %490 %2005, 12:46
Ik heb al op internet gezocht enzow, maar kan nergens echt wat goeds vinden.
Ik wil dus gewoon dat er komt te staan:

De flashmovie is al *aantal procent* geladen

wie kan me helpen?

alvast bedankt
groeten royboy aka flashboyroy :)

TheDutch
%Europe/Berlin %492 %2005, 12:49
Even voor de duidelijkheid...jij hebt niet gezocht! Google zit stamp vol met dit spul en met de keywoorden "flash+preloader+procenten", had je alles gevonden wat je zocht. Dus niet meer onzin verkopen :).


// Percentage
(getBytesLoaded/getBytesTotal)*100

royboy
%Europe/Berlin %498 %2005, 12:57
Even voor de duidelijkheid...jij hebt niet gezocht! Google zit stamp vol met dit spul en met de keywoorden "flash+preloader+procenten", had je alles gevonden wat je zocht. Dus niet meer onzin verkopen :).


// Percentage
(getBytesLoaded/getBytesTotal)*100


kj, nou, ik kan wel werken met flash, maar action script he'k me nog nooit in verdiept..
dus zou eigenlijk nie wete wa'k met die code moet doen, en dattie daarna ook doorword
verwezen naar andere scene. (gotoAndPlay code ken ik wel hoor :) :p )

kan iemand me hierbij nog helpe? :rolleyes:

theFlashWizard
%Europe/Berlin %500 %2005, 13:01
kan aan mij ligge hoor.. maar volgens mij hebbe we bij tuturials->actionscript n hele aparte afdeling voor preloaders.. dus nee.. probeer die eerst maar.. kom je er dan niet uit kunnen we altijd helpen..

TheDutch
%Europe/Berlin %502 %2005, 13:03
Dan zou ik mezelf als ik jou was maar eens goed gaan verdiepen in ActionScript en pas daarna dingen in Flash gaan maken. Want tegenwoordig kan je zowat niet meer in Flash doen of je hebt ActionScript nodig :).

Er is een topic "boek", die moet je maar eens lezen voor goed boek advies.

theFlashWizard
%Europe/Berlin %513 %2005, 13:19
en in de topic AStips staan beginers tips en een verzameling tuturials..
waarbij ik iedereen nog oproep om, als je nog n goede tuturial weet et ff te melden..

Laiverd
%Europe/Berlin %546 %2005, 14:07
Hier wat info over preloaders die ik ooit eens op papier heb gezet:

The basics on preloaders

This document aims at providing you with some basic information on how what preloaders are and how they basically work. This document assumes:
- that you’re familiar with the concept of multiple timelines
- that you understand what functions, function parameters and variables are

Preloaders are a means to provide the visitor of your website with some visual information on the progress of loading content. The visual information may consist of anything you think of, including a progress bar, some textual information, a combination of both etc.
This info is not so much about the way you visually represent the loading status, but focuses more on the mechanisms behind it.

Note that preloaders are not a means of increasing the speed with which your webpage downloads. It’s merely a means to ‘entertain’ the visitor, and does not provide you with an excuse to not think about efficiently building your website.

How does it basically work?
Any preloader makes use of two standard MovieClip methods to ‘measure’ how much data have been loaded into a target (either the main timeline or a movieclip)
1. target.getBytesLoaded() : returns the total amount of bytes that has been loaded into target (often a movieclip).
2. target.getBytesTotal() : returns the total amount of bytes that have to be loaded into target (often a movieclip).

We use the above methods inside a loop, using either the onEnterFrame or the setInterval method, to continuously check the outcome of the above mentioned methods.

On each run of the loop we compare the data for getBytesLoaded() and getBytesTotal(). As soon as these are equal everything has been loaded and we can stop the loop.

So the basic structure for any preloader is:

this.onEnterFrame = function(){
// we put getBytesLoaded() and getBytesTotal() in a variable for convenience
t = MovieClipName.getBytesTotal();
l = MovieClipName.getBytesLoaded();
// check if the are equal
if(l == t && t > 4){
// do whatever
doThings();
// don’t forget to stop the loop
delete this.onEnterFrame;
}
}


Visual representation
In almost every case you will want to provide the user with some visual representation of the status of loading. Almost always the percentage of the amount to load provides a good basis for this visual representation; you can use it for increasing the width of a progress bar and/or for providing the visitor with textual information.
This is how you calculate the percentage that has been loaded:

// we put getBytesLoaded() and getBytesTotal() in a variable for convenience
t = MovieClipName.getBytesTotal();
l = MovieClipName.getBytesLoaded();
// calculate percentage p; note that we round the number
p = Math.round(l/t * 100);

As all of the code is inside the loop, we can use p to increase the width of a movieclip bar_mc”
bar_mc._width = p;

Or we use it to display the percentage that has been loaded in text:
textfieldName.text = p +”% has been loaded”

If we want to display the number of kilobytes that has been loaded compared to to total number of Kb’s, we can do it like this:
// divide by 1024 to turn bytes into kilobytes rounding the values
kbTotal = Math.round(t/1024);
kbLoaded = Math.round(l/1024);
// put it in a textfield
textfieldname.text = kbLoaded + “ kB of “ + kbTotal + “ kB has been loaded”

Some things to remember
- The methods getBytesLoaded() and getBytesTotal() return the number of bytes. If you want Kilobytes, simply divide the number by 1024 (1024 bytes = 1 Kb);
- To save yourself typing; save the values for getBytesLoaded() and getBytesTotal() in a variable like :
t = MovieClip.getBytesTotal();
l = MovieClip.getBytesLoaded();
- If you’re loading into an empty MovieClip, note that you also check for getBytesLoaded() > 4, as the MovieClip itself has an initial size of 4 bytes.

wargames at mtd
%Europe/Berlin %824 %2007, 19:46
hallo
We moeten bijvoorbeeld 1000 leeftijden invoeren via een drukknop die door op de drukknop te drukken een inputbox geeft.

Als we 999 intikken dan moet het programma eigenlijk starten om de gemiddelde leeftijd te berekenen.

Voorbeeld:

Ik heb iemand die 20 jaar is, iemand die 50 jaar is en iemand die 12 jaar is.

En als ik dan 999 intik zoals de vorige leeftijden dan moet het programma de gemiddelde leeftijd berekenen.

Hier is dit (20+50+12)/3.



Ik hoop dat je mij kunt helpen

Emveedee
%Europe/Berlin %836 %2007, 20:04
En wat is nou je vraag?
Trouwens, dit topic heeft al een grijze baard,
start even een nieuwe

fons
%Europe/Berlin %845 %2007, 20:16
tjonge jonge jonge, het gaat van kwaad naar erger.

wtf heeft die vraag met deze topic te maken

EDIT:
een topic van anderhalf jaar oud !!