PDA

View Full Version : can some please help me create this preloader


dcypher1986
03-03-2004, 08:15 AM
Howdy everyone,
I recently saw this site and i love the preloader used as the site very firstly loads. the site is toni and guy (http://www.toniandguy.ie) its the preloader with the percentage text that folows the mask. i have seen this discussed on other flash forums and so far i havent seen someone create a functional preloader the same. I would very much appreciate it if someone could help me. thankyou.

dcypher1986
03-04-2004, 01:20 AM
please anyone? id really like to know how to make this type of preloader

splict
03-04-2004, 02:07 AM
do you already know how to make a preloader? if not follow one of the many tutorials.

Okay, now, you should have a variable to represent the percentage loaded. You should also have an onEnterFrame loop (more likely), or a setInterval (less likely) that this variable is updated in. Simply assign this variable (Number) to the _x property of your textField. Each frame, this would move your textfield from
// NOT ACTUAL CODE TO USE
//
//when your percentage is zero
myTextField._x = 0;
// to
myTextField._x = 100;

If your mask starts at a different x coordinate just add that to the textField's _x value. If it is longer or shorter than 100, just multiply it by that amount. So if your preload bar's _x was 50 and it was 200 pixels wide (when it was fully loaded) you would have something like the following code inside of your preloader's onEnterFrame:
var myPerc:Number = Math.round((_getBytesLoaded/_getBytesTotal)*100);
myTextField.text = myPerc+"%";
myTextField._x = myPerc * 2 + 50;
make sense?

btw, what do you mean you have seen it discussed but not seen a functional one?

-splict

dcypher1986
03-04-2004, 06:13 AM
thanx very much mate yes i understand it. i mean i have seen other forums have people ask how to do it but no one was able to help them. much appreciated

dcypher1986
03-04-2004, 06:22 AM
Actually ahahah nah i dont understand it. do you think you could please put it in a fla for me how i should work it. please. thankyou

splict
03-04-2004, 01:32 PM
you want to just show your preloader code (or fla) and we can see where you've gone wrong?

dcypher1986
03-04-2004, 11:30 PM
nah id prefer it if you could just upload it working so i can see how its done. im not real good with actionscript. so yeah it didnt work when i tried it. thanks

splict
03-04-2004, 11:33 PM
well, you're probably going to take this rudely, and I certainly don't mean it that way, but, I don't have the time or desire to just do it for you right now. Hopefully someone else can help. :)

CyanBlue
03-04-2004, 11:36 PM
Yeah... There is no reason to make another preloader threads when there are way too many already out there...

Go check out the tutorials page and search the forum with the oldnewbie for the username and you shall be able to find his post at the FlashKit which probably will be solving your problem... :)

dcypher1986
03-12-2004, 01:03 AM
Hey guys im back again this time i have some code. In theory it should work but yeah im not sure,

i have 3 frames in my timeline.

on frame one i have:

the code:

bytes_loaded = _root.getBytesLoaded();
bytes_total = _root.getBytesTotal();
precent_loaded = int (100 * (bytes_loaded / bytes_total));
loaded_text = precent_loaded add "% loaded";
logo.bar._width = precent_loaded * 1.85;
logo.loaded_text._x = Math.floor(logo.bar._x + logo.bar._width);

i also have on frame 1 a movieclip with the instance name "logo". this clip contains a dynamic text box with the instance name "loaded_text" and a movieclip called "bar" which contains a 1*10px shape

on frame 2 i have:

the code:

if (bytes_loaded == bytes_total) {
play();
} else {
gotoAndPlay (3);
}

on frame 3:
i have an image and a stop(); action


can someone please help me to get this working.

thanx

timothye
03-12-2004, 01:48 AM
maybe look at this as for the other 2 that said there are way too many preloader threads ,its TRUE.find one that works and use it .
http://www.kirupa.com/developer/mx/percentage_loader.htm

dcypher1986
03-12-2004, 02:52 AM
i dont think ur listening mate. i know how to make a preloader. what i dont know how to do is make the percentage move as the bar increaces size like in www.toniandguy.ie all the code is there guys i just need opinion on how to get the percentage to stop moving the opposite way and how to get the numbers to show. cant be that hard?

Billy T
03-12-2004, 04:05 AM
if (bytes_loaded == bytes_total) {
play();
} else {
gotoAndPlay (1);
}

you had gotoAndPlay(3)

cheers

Billy T
03-12-2004, 04:07 AM
also you target loaded_text as

loaded_text

and

logo.loaded_text

so which is it?