Share
View previous topicGo downView next topic
avatar
Spritan
Spritan
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Preloader help

on 1/18/2014, 12:30 am
Hi... i don't really like asking for help but ...

I want to know if somebody have a good understanding about preloaders and teach me how to make one, something like the forum preloader. I already know the basics but I want to learn a little more about it.





avatar
Spritan
Spritan
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profilehttps://twitter.com/tjcallwoodhttps://www.facebook.com/TJ Callwood

Re: Preloader help

on 1/18/2014, 2:06 pm
@ayaiken wrote:Hi... i don't really like asking for help but ...

ALWAYS ask for help not everyone knows everything so what we do know is shared, and no one should rage at you for asking. Sadly I don't have the knowledge you seek but someone here definitely does.





avatar
Administrator
Administrator
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 2:25 pm
@ayaiken wrote:Hi... i don't really like asking for help but ...

I want to know if somebody have a good understanding about preloaders and teach me how to make one, something like the forum preloader. I already know the basics but I want to learn a little more about it.
well
in the first frame you have to stop it via
Code:
stop();
after that just make a function that gets called every few milliseconds, which you can do via setInterval()
so im guessing something like this
Code:
intervalName = setInterval(loadFunction, 10);
that'll call the function "loadFunction" every 10 milliseconds iirc (im not sure if thats milliseconds or something else)
then you just make the function for loadFunction, and inside that function make a variable to check how much of the movie is loaded
so:
Code:
function loadFunction() {
var loaderInt = Math.round(getBytesLoaded() / getBytesTotal() * 100);
}
basically that makes a variable to see the amount of bytes loaded divided by the amount of bytes total (aka the the percentage of whats currently loaded out of whats left to load)
the math.round just makes it a neat number w/o decimals
after that, then you just have to check if its completely loaded so:
Code:
function loadFunction() {
var loaderInt = Math.round(getBytesLoaded() / getBytesTotal() * 100);
if(loaderInt >= 100) {
clearInterval(intervalName);
play();
}
}
that checks that if the its fully loaded, it clears the interval that calls the function over and over again and plays.
as for the preloader bar itself
Code:

stop();
intervalName = setInterval(loadFunction, 10);

function loadFunction() {
var loaderInt = Math.round(getBytesLoaded() / getBytesTotal() * 100);
if(loaderInt >= 100) {
clearInterval(intervalName);
play();
} else {
MovieClipInstanceName._xscale = loaderInt;
}
}
if the movie isnt fully loaded, itll resie the width of the movie clip with the instance name of "MovieClipInstanceName" based on the percentage of how its loaded

i dont have flash on me so im not sure how well that works but it should work s0





avatar
Administrator
Administrator
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 2:26 pm
I can teach you how to make a preloader, however the flashy cool ones that you see are things that are just done aesthetically.

Is it AS2 or AS3?

Once you tell me that, I'll help you more.







[The Return]
avatar
Spritan
Spritan
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 2:51 pm
@Patt wrote:I can teach you how to make a preloader, however the flashy cool ones that you see are things that are just done aesthetically.

Is it AS2 or AS3?

Once you tell me that, I'll help you more.

Oh yeah sorry, It's AS2





avatar
Administrator
Administrator
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 4:42 pm
Then Joey's code will work.

Now, to make it look nice, you have to do different things within the preloading screen. Like Proxicide's MK vs. SF 3 preloader was just a box, but it was very graphically appealing. You can use a rectangular box, but you have to add many different things to make it look nice.







[The Return]
avatar
Spritan
Spritan
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 6:12 pm
@Patt wrote:Then Joey's code will work.

Now, to make it look nice, you have to do different things within the preloading screen. Like Proxicide's MK vs. SF 3 preloader was just a box, but it was very graphically appealing. You can use a rectangular box, but you have to add many different things to make it look nice.

I see, thanks a lot fot the help !! and thank to @sieghart it works fine for me !!

another thing ... this will sound dumb ... but what if I want to give the preloader a intro just like this http://www.deviantart.com/art/Preloader-by-Devart-et-SwanArt-142552099 ?





avatar
Administrator
Administrator
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 6:23 pm
Well, you didn't really get to see the bar load because there wasn't much for it to load, so it happened very quickly, but basically you would just move your loading item around. Do you know what I mean?







[The Return]
avatar
Spritan
Spritan
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 7:23 pm
@Patt wrote:Well, you didn't really get to see the bar load because there wasn't much for it to load, so it happened very quickly, but basically you would just move your loading item around. Do you know what I mean?

Yeah, I get it thanks !!





avatar
Administrator
Administrator
Reputation:
Age:
Posts:
Registration Date:
Location:
View user profile

Re: Preloader help

on 1/18/2014, 7:38 pm
@ayaiken wrote:but what if I want to give the preloader a intro just like this http://www.deviantart.com/art/Preloader-by-Devart-et-SwanArt-142552099 ?
the preloader is inside a movie clip and is animated inside of that
basically inside the movie clips first frame instead of stop(); youd use _root.stop(); iirc
and when the movie is fully loaded instead of play(); youd use _root.play();





View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum