hello
i would like to know how to make a loading bar in flash, like you see on most of the web site when you’re opening a new page
if anyone can help me or is there any tutorials about it?
thanx /jim
I think I remember a “How to build a status bar preloader in Flash”, under tutorials Flash Preloader
good luck
How much experience do you have with Flash? How experienced are you with Actionscript?
i’m quite good in animation, i can make nice product presentation.
I have some basics in Actionscript, but I used to program in Java J++, somehow you can find things in commun./ jim
this tutorial is great
Here is a preloader I wrote a LONG time ago. It’s AS 1.0 and some of the code may be depricated. You should check out the Kirupa link above. I’m sure they have a more elegant solution, but this works.
/*--------------------------------------------------------------------------
Preloader Component
----------------------------------------------------------------------------
J. Moak
August 31, 2003
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Description:
This preloader tracks the load status of its parent movie clip and sends a
message when that clip is loaded. The parent clip MUST have an
"onMovieLoad" event defined to handle the event broadcast. In addition,
the _root movie needs to contain the "EventBroadcaster" object.
(Other options:
- Hardcode the "Finished" functionality here and force the parent MC to
accommodate it (ie, if (loaded) {_parent.gotoAndPlay("loaded");).
- Use a frameloop listener in the parent clip to continually check the load
status of this preloader MC.
The eventHandler method seems more elegant. Email me if you have any
comments.
----------------------------------------------------------------------------
*/
// Initialize Code (doesn't run until bytesloaded is > 0 - workaround for
// bytesloaded bug in Flash.
function initialize () {
// initialize load variables
this.loadtarget = _parent;
this.totalbytes = -1;
this.bytesloaded = -1;
this.ratio = -1;
// make this preloader broadcast events:
loadObj = new Object();
EventBroadcaster.initialize (this);
// subscribe the _parent as a listener:
this.addListener (_parent);
// create loop host mc to continually check load status
this.createEmptyMovieClip ( "bytechecker",2000);
// set bytechecker to check bytesloaded - don't start tracking load status
// until the loading has started.
this.bytechecker.loadtarget = loadtarget;
this.bytechecker.onEnterFrame = function () {
//check bytesloaded
if (loadtarget.getBytesTotal() > 0) {
this._parent.totalbytes = loadtarget.getBytesTotal();
this._parent.startLoadTracking();
this.removeMovieClip();
}// endif
}// end onenterframe
}// endinitialize
function startLoadTracking () {
this.createEmptyMovieClip ( "looper",2000);
// set looper to track bytesloaded and set variables
this.looper.onEnterFrame = function () {
bytesloaded = this._parent.loadtarget.getBytesLoaded();
this._parent.ratio = this._parent.totalbytes / bytesloaded;
this._parent.percentage = Math.ceil(this._parent.ratio * 100);
bytes_disp = Math.ceil(bytesloaded / 1024) + "k/" + Math.ceil(this._parent.totalbytes / 1024) + "k";
if (bytesloaded > 98) {
bytes_disp = "Data Loaded";
this._parent.gotoAndPlay("transOut");
this.removeMovieClip();
}// endif
}// end onEnterFrame
}// end startLoadTracking
edit: added Code tags to maintain formatting
thank you every one
i guess i will manage to do it now, it’s really great!
/jim
Let me know if you need any more help. I need to brush up on my Flash