A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX] Loading Bar

  1. #1
    Flash Intermediate XenElement's Avatar
    Join Date
    Sep 2008
    Location
    At my computer
    Posts
    196

    [MX] Loading Bar

    Ok, I don't know how to say this without sounding stupid, but...

    I started a game, and it seems great, but I forgot to put in a loading bar.
    How stupid is that!!??
    is there any way I can put one in without messing the whole thing up?
    In the process of designing a quirky little game engine called gulp. Check out it's progress below: @ my blog.

    ---

    Check out my blog at XenElement.com

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    that depends,
    just make a backup of your fla file and try one of the many preloader tutorials out there
    http://www.google.com/search?hl=en&c...er&btnG=Search

    it basicly goes like this in most cases:
    you put this code on the very first frame and the whole game after that (e.g frame 2 or better 3 or so:
    PHP Code:
    stop();
    onEnterFrame = function(){
        var 
    int(_framesloaded);// in case of Null or undefined it returns 0
        
    var int(_totalframes);//same here
        
    if (== && 0){
            
    delete onEnterFrame;
            
    play();
        }else{
    //preloading...
            
    var a/b;
            
    trace("movie Loaded: "+int(p*100)+" %");
            
        }

    what it does is for example if you have set your framerate to 32 fps it checks 32 times per second if the loaded bytes of your flash movie match the total to be loaded bytes.
    Anytime between that it traces out the loaded state in percentage,- you can switch that with a textfield displaying the progress of whats been loaded so far- but then dont forget to embed the digit characters or else anyone else sees a ugly times new roman font without anti- aliasing.

  3. #3
    Flash Intermediate XenElement's Avatar
    Join Date
    Sep 2008
    Location
    At my computer
    Posts
    196
    Thanks, its a big help. Btw nice job with your game, cant wait to see ur next entries to the competition.
    In the process of designing a quirky little game engine called gulp. Check out it's progress below: @ my blog.

    ---

    Check out my blog at XenElement.com

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