need help for creating a loading bar ?

  • kaigazette
  • Born
  • Born
  • kaigazette
  • Posts: 3

Post 3+ Months Ago

can anyone help me.... i'm still new to flash things ....
here my problem
> i having a flash web design project .... and i planning to do a loading bar page.... how i do that and how to load from loading page to intro page than my main page ...?

sry my English abit suck but hope u all can help me please :)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Belk Media Group
  • Graphic Monk
  • Professor
  • User avatar
  • Posts: 778
  • Loc: In the heart of California, Fresno.

Post 3+ Months Ago

Well I dont know how others do it but here's how I do.

First lets start with creating the script for loading and going to the next scene upon complettion:
Code: [ Select ]
// math formula for converting bytes into kb and finding the percentage between loaded and total

a = getBytesLoaded();
b = getBytesTotal();

// equals percent

c = ((a/1024)*100)/(b/1024);

if (a==b) {
nextScene();
}

// or gotoAndPlay(scene, 1);

//This controls the progress bar

setProperty (progressbar.bar, _x, c)
  1. // math formula for converting bytes into kb and finding the percentage between loaded and total
  2. a = getBytesLoaded();
  3. b = getBytesTotal();
  4. // equals percent
  5. c = ((a/1024)*100)/(b/1024);
  6. if (a==b) {
  7. nextScene();
  8. }
  9. // or gotoAndPlay(scene, 1);
  10. //This controls the progress bar
  11. setProperty (progressbar.bar, _x, c)


Thats all there is to it as far as scripting goes. Simple, huh? :)

- Now creat a movie clip (instance name: progressbar) and inside it make your progress bar with a width of 100px and set the x value position to 0(zero).
- Duplicate the layer.
- Set the top layer to mask by right clicking and selecting mask from the options.
- On the top layer set the x value position of the bar mask to 100.
- Convert the bar to a movie clip and give it an instance name of bar.
- Done.

Basically what is going on is; the variable c is counting from 0-100
so the script is going to make sure that the _x value of the bar stays equal to c thereby causing the position of the bar to move smoothly from 0-100

Please note: I wrote this lil tut without refering to my Flash App so if I left out anything...Just holla, peace.
  • kaigazette
  • Born
  • Born
  • kaigazette
  • Posts: 3

Post 3+ Months Ago

sry hor sound easy but i hardly understand:P.... got any screen shot or anything
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i got another suggestion: learn flash first, come ask later.
  • kaigazette
  • Born
  • Born
  • kaigazette
  • Posts: 3

Post 3+ Months Ago

i really need it please
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

go to actionscript.org or kirupa.com. They have nice samples about preloaders and progress bars. Or simple google for "flash create preloader with progress bar"

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 10 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.