View Full Version : Loading Screen ActionScript
TheGLIVEN
07-29-2005, 01:59 PM
In Macromedia Flash MX Pro 2004, what is the ActionScript needed to make a loading screen for a Flash cartoon?
redDragon
07-29-2005, 08:12 PM
A loading screen? Well the way I do it is I have one text box to show the percentage of the thing loaded, a movie clip of a rectangle to use as a percentage bar, and a button to actually start the cartoon.
So basically what the code does is in the first branch of the if statement, it checks whether or not all the frames have loaded and if so it just shows the start button. If all the frames haven't loaded it shows the percent of frames loaded as a number and visually with a bar.
_root.onEnterFrame = function()
{
if (_root._framesloaded == _root._totalframes)
{
loading_txt._visible = false;
preloaderBar._visible = false;
start_btn._visible = true;
}
else
{
loading_txt._visible = true;
preloaderBar._visible = true;
start_btn._visible = false;
loaded = (_root._framesloaded/_root._totalframes)*100;
loading_txt.text = loaded + "% Loaded"
preloaderBar._xscale = loaded;
}
}
TheGLIVEN
07-30-2005, 08:59 AM
A loading screen? Well the way I do it is I have one text box to show the percentage of the thing loaded, a movie clip of a rectangle to use as a percentage bar, and a button to actually start the cartoon.
So basically what the code does is in the first branch of the if statement, it checks whether or not all the frames have loaded and if so it just shows the start button. If all the frames haven't loaded it shows the percent of frames loaded as a number and visually with a bar.
Do I have to make the text box a symbol?
redDragon
07-30-2005, 01:53 PM
Do I have to make the text box a symbol?
You shouldn't have to.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.