A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: flashlevel preloader

  1. #1
    Senior Member
    Join Date
    May 2003
    Posts
    213

    flashlevel preloader

    peepz,

    I don't get exactly how they do the whole preloader animation on: http://www.flashlevel.com/indexv4.html

    every time i visit the page the whole preloader animation runs for 0 till 100. also if it is in your cache.

    they use 20 stripes to load so (5 percent means 1 stripe!) but how can you animate your preloader if youre preloader does'nt always runs smoothly from 1 till 100?

    thnx for your help!

    greetz!

  2. #2
    Senior Member
    Join Date
    Apr 2003
    Location
    MA
    Posts
    273
    There's a simple way to do a smooth preloader, which I'm sure several sites use so that the preloader doesn't jerk up to the next number. When you're loading, there are two variables, actual percent loaded, and visual percent loaded. In concept, what you do is add a set amount to your "visual percent" variable, which controls the length of the preloader bar. So in your preloading loop, if the visual preloader < actual bytes loaded then add say, 5 to it. That way it will always go up in increments of five, no matter how much of the movie is loaded. Get what I'm saying?

    So in this case, if the movie is cached, the actual percent loaded will jump straight to 100, but the visual display is upped in increments of one bar per loop, so it will keep adding one bar and it wont show the movie until the visual part is done.

    Hope that helps.

  3. #3
    Senior Member
    Join Date
    May 2003
    Posts
    213
    i don't get it exactly (maybe your can write a small example?)

  4. #4
    Senior Member
    Join Date
    Apr 2003
    Location
    MA
    Posts
    273
    Sure, here you go. Read the comments on the first actionscript frame.

    http://www.delvarworld.com/stuff/duck.fla

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center