I can give you the basics, if you have the knowledge of Flash MX AS and its GUI.
Basically, there are 2 main system variables you want to mess with getBytesLoaded() and getBytesTotal(). You can reference them by _root. when needed.
Also, you want to scale an image (x-axis) depending on the percent complete, right? As well as place dynamic textbox on the stage that shows the percent loaded.
textbox - instance name of txtPercentLoaded
loading bar - intance name opf imgLoadBar
on Frame 1 add a keyframe with the following AS
Code:
infoLoaded = _root.getBytesLoaded();
infoTotal = _root.getBytesTotal();
percentLoaded = Math.round(infoLoaded / infoTotal);
_root.imgLoadBar._xscale = percentLoaded;
_root.txtPercentLoaded.text = percentLoaded + " %";
if (percentLoaded >= 100) {
_root.gotoAndPlay(10);
else {
_root.gotoAndPlay(1);
}
BTW, frame 10 is where you start the movie (ie, fade your image load bar and textbox away and get with the program, cause everything is loaded
So basically, we
1. Create variables to hold the bytesLoaded and totalBytes of the movie.
2. Find the actual percent loaded and place it into a variable by divinding bytesLoaded by totalBytes
3. Scale the image bar via the percent loaded (note that xscale = 0 is nothing, xscale = 100 is the image and xscale = -100 is the image, inverted horizontally.
4. Make the text box say what percent is loaded and then tack on a "%" on the end so it says "4%", "23%" "100%"
5. Check to see if percentloaded is 100, if so, goto starting movie, if not goto the frame that rechecks all this again (frame 1)
Hope that helps
Bookmarks