Flash loading script
- Started
- Last post
- 23 Responses
- SoulFly
Is this a common loading script, or is this manually done, in a different way by each designer?
I'm talking about the loading "bar" that goes across the top as a page loads up. I see this in many sites. How do I find this script? Is it already part of Flash?
Here's an example I just saw in another thread one of the portfolios from QBN
- PonyBoy0
simply put... use this equation at the beginning of your site:
pctLoaded = Math.round(getBytesLoaded()/getB...
someConstant can be any number - but... the final number (once bytesTotal == bytesLoad) will be THAT number...
... so if you made someConstant = 100... you'd get a 1-100 scenario...
... make sense?
so... create an interval that checks that variable every few milliseconds - you can base the size of your loadbar on that someConstant variable... or you can tell a movieclip to gotoAndStop(someConstant);
... there's lots of ways. :) ... but that little equation will give you the power over all the data in your fla (as long as you're not loading in external data).
- SoulFly0
airey, thanks for your attempt, but I don't think you understood my question.
Thanks for the google page with search results of generic preloaders for "Flash 5" tutorials.
But I use Flash CS3 at the moment.
- airey0
the point is, there's a million preloader scripts, components, tutorials, math solutions, etc etc. you can go to Flashden or ultrashock (as examples) and buy one of a million that will suit your needs.
the AS2 / AS3 is the most important question.
- SoulFly0
Here's another example, http://stuffbyme.com/
In this case the bar it loading vertically. This seems to be a trend with many designers.
- airey0
also, a note with some of the tutorials / files, the preloader quite often uses the value of the root file and relates that to the bytes loaded. i've had issues with that kind of preloader when loading external swfs into blank movie-clips (containers). so, basically work out the method you're calling in files (levels vs. mclips) and go from there.
- acescence0
the concept of all of them is the same, the number of bytes loaded divided by the number of total bytes multiplied by 100 will give you the percent loaded. you then need to scale an object to represent the amount loaded vs the total amount
- funkage0
I don't quite get your question. I don't think that the loading bars are part of Flash. They're manually written scripts.
- PonyBoy0
if you're loading anytihng in externally...
... create an empty movieclip... then use the movieClipLoaderClass...
... piece of cake w/that!!!!... has all the methods and variables you need...... you'd just need to build your site in one swf... create a 'main' swf that just creates an empty movieclip and uses the movieclip loader class... 'onLoadInit' (one of the methods of that class) triggers any events once the external file is completely loaded... 'onLoadProgress' updates as the movieclip data loades... this is where you'd that loaded/total*constant equation...
- I see. Actually makes sense to do it this way, if you want to update your portfolio often.SoulFly
- SoulFly0
funkage - thanks, so there is heavy scripting involved. That answers my question.
I've just seen a lot of this style used. the "thin bar going across the page" as each image of a portfolio loads.
- PonyBoy0
i wish it wasn't so late... i'm making it sound so confusing... what acescence just said above handles what i've been trying to say... with much less words. :)
- digival0
I'd stick with AS2 just for compatibility reasons for now, but why are you using flash if you don't know flash? Play to your strengths - if a preloader script is confusing you, you're screwed.
- if he's just learning though, i'd start with as3 since they are completely differentacescence
- i agree w/acePonyBoy
- doesn't AS3 seem to complicate things?funkage
- not at all... it'll force 'standard' oop scripting... if you know .js... this'll be a snap!PonyBoy
- does it sound like they know js? if you get into a place who designs for mainstream web, you'll be screwed if you know 3 and not 2.
digival
- funkage0
Actually, I wouldn't call it heavy scripting. Let's put it simply: you put a bar with "0" width somewhere, and calculate the percentage of the file being loaded. Apply that percentage to the bar's width. Tada: preloader bar.
- SoulFly0
digival- I know AS in intermediate level. I just don't use it that often.
I know C++ and other object oriented languages fluently.
I've done a lot of animation in Flash, just not a lot lf AS.
- jpea0
If you want to learn, pick up the O'reilly/moock definitive actionscript book and your programming skills will help you out immensely. If you have a dev background, that book is way easier than picking up methods from the web. Preloaders will be the least of your worries by then.
- SoulFly0
cool... I used Moock's website back in 2001!
I used to be a game programmer when I was in school- then I got into Flash from 2000-2001 but then quickly got into package design, which I've been doing ever since. So I don't have a dev background for internet per say... The thing is, I have some sustainability and green packaging projects that I want to use Flash for presentation purposes, like an animation I have in mind to show how a company can transition from a traditional packaging into green packaging, for example.
- mr_clark0
Here's one from Flashden but it comes as fullscreen file -