View Full Version : Loading bar newbie help

02-04-2008, 09:46 PM
Hey guys,

Im a serious newbie at flash, i followed a basic tutorial to get a preloader on my site, and it works, but i want to make the loading bar much larger and i cant figure it out.

As it stands it goes something like this:

Loading <percent>
<small loading bar>

I want to make the loading bar stretch almost the whole way across my document but i cant see any properties that determine how wide the bar is.

I have uploaded my FLA here: Link (http://www.uploading.com/files/P6AQ3NGT/site.fla.html)

I would really, really, really appreciate it if someone could have a quick look and tell me where i can define the width of the loading bar.


02-04-2008, 10:13 PM
What version of Flash are you using? Its telling me that the file is of unexpected format. You change the width and height in the properties window. You'll see them on the left side next to the _x and _y information. Sometimes, the width and height options are collapsed (hidden) and you have to make them available. There are two ways you can do this. Have a look at the gif file I'm attaching.

02-04-2008, 11:14 PM
Thank you for the help. I saved the file in flash 9 (cs3).

Im able to make the starting block wider (starts at 1px width) using your method above, but the code involved in tiling / stretching the loading bar across in relation to the percentage loaded doesnt change, i want to change the width of the bar when it is 100&#37; loaded and make it proportionate to the percentage loaded.

The trouble is i cant find that code, there doesnt seem to be any code to tell that bar to tile across the more that it has loaded, which is crazy because there must be.

Edit: Here is what im after if i didnt explain it very well above-

02-04-2008, 11:58 PM
I only have Flash 8 is there an option to save for older compatibility in CS3? Usually, there is an layer labeled 'Actionscript' or 'Actions' or something in the timeline. Keyframes that have a lowercase "a" in them contain actionscript. Since its a preloader it will be somewhere in the first few frames.

This is how I do my basic preloader in AS2.

- I have an instance movieclip named 'preloader' that is 165px wide.
- I also have a dynamic text field named 'loadText'.

//Frame 1
var amountLoaded:Number = _root.getBytesLoaded() / _root.getBytesTotal();
preloader._width = amountLoaded * 165; //165 is the total width of my movieclip
loadText.text = "loading..." + Math.round(amountLoaded * 100) + "&#37;";

//Frame 2
if (_root.getBytesLoaded()==_root.getBytesTotal()) {
else {

02-05-2008, 12:57 AM

Thanks again for the help, call me picky but i really want a loading bar, the one i have is perfect it just doesnt look good how it is in my opinion.

I have uploaded a flash 8 compatible version here: Link (http://www.uploading.com/files/DN3LUMUG/site8.fla.html)

Could you please have a look?



02-05-2008, 01:58 AM
That would have a loading bar (preloader is the instance name of it where as you have it named loadbar).

Here is a quick video that will clear everything up for you.
Watch Lee Brimelow's Basic Preloader Video (http://www.gotoandlearn.com/player.php?url=basic_flash_preloader.flv&width=640&height=480)

02-05-2008, 02:18 PM
Ive got a preloader, and its working, its just not very wide, i want to make it wider. I can just adjust the width of the image, but there is some kind of code im assuming that adjusts the width of the bar, and i want to work out how to make the width of 97% loaded 600px instead of 180px that is at the moment for example.

02-06-2008, 02:56 AM
I downloaded the .fla that you've uploaded. I wasn't able to make sense of what was going on with the preloader. I was able to have it start off as wide as you wanted but it would then contract back down to the smaller size. In addition, the preloader would be simulated every time I played the movie even tho it was loading locally.

You are correct. Currently, you have a preloader that does work. However, it does not work in the way which you'd like it too. Nay do you have a way to get it to work in which you intend. You can spend another two days trying to figure out why on this forum.....or you can use another method that is adaptable to your needs. If you insist on correcting your method I'd suggest that you try out actionscript.org or another forum for further assistance b/c I personally don't use flash enough to correct it. (Even though I'm sure its simple.) Or wait until someone more comfortable with flash enters your thread.