need help for creating a loading bar ?

  • kaigazette
  • Born
  • Born
  • No Avatar
  • Joined: Jul 31, 2007
  • Posts: 3
  • Status: Offline

Post July 31st, 2007, 8:02 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 31st, 2007, 8:02 pm

  • Belk Media Group
  • Graphic Monk
  • Professor
  • User avatar
  • Joined: Jan 12, 2005
  • Posts: 778
  • Loc: In the heart of California, Fresno.
  • Status: Offline

Post August 1st, 2007, 2:53 am

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
  • No Avatar
  • Joined: Jul 31, 2007
  • Posts: 3
  • Status: Offline

Post August 1st, 2007, 4:54 am

sry hor sound easy but i hardly understand:P.... got any screen shot or anything
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post August 1st, 2007, 6:41 am

i got another suggestion: learn flash first, come ask later.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • kaigazette
  • Born
  • Born
  • No Avatar
  • Joined: Jul 31, 2007
  • Posts: 3
  • Status: Offline

Post August 1st, 2007, 7:40 am

i really need it please
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post August 1st, 2007, 7:49 am

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"
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 32 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.