Results 1 to 8 of 8

Thread: Flash loader bar

  1. #1
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Flash loader bar

    I was in the process of making a loading bar of my own using somewhat same deign as the rep point display thini and i was using this code

    ifFrameloaded("Main",1) {
    gotoAndPlay("Main",10);
    }

    and it did not quite work

    i was using 10 graphic sinbols each one is like 10 percent

    can anyone give me a hand and make some samples and see if there is anything else I have to do

    thanks

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You want to use frame labels instead of scene names. It is actually an easier check point for Flash.

    Here is one of the easiest, but most eye catching loaders to make:

    First make your MCs.

    1) Make an MC that has the text "Loading"

    2) Make an MC that has the text "PLAY" (or done, or go, etc..)

    3) Make a progress bar. This should be a plain nice bar with a color or fill gradient motion tweened from "empty" to "full" (masks work nice here too)

    4)Put all these on your stage in 3 sequential frames. the loading text, bar and tweens on frame one and frame 2, play text on frame 3. Obviously, here we want to give the bar an instance name of "bar"

    5) label frame 3 as "loaded"

    6) in your actions layer on frame 2 put this:

    Code:
    gotoAndPlay(1);
    7) in your actions layer on frame 1 put this:
    Code:
    PercentLoaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;
    if (PercentLoaded != 100) {
    	bar._xscale = PercentLoaded;
    } else {
    	gotoAndStop("loaded");
    }
    Then in your Play MC's actions you can put

    Code:
    on(release){
        gotoAndPlay("10");
    }
    For an even simpler method:

    2 frames. In the first make a dynamic text box with the var label "myOutput"

    then in the actions layer put this:

    Code:
    var percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
    var myOutput = _root.percent +"% is now Loaded";
    In the 2nd frame make sure the dynamic text box is in the same spot as in the first, and put this in the actions layer:

    Code:
    if(percent == 100){
    	gotoAndPlay(10);
    }
    else{
    	gotoAndPlay (1);
    }
    This will make a text percentile ( 1% counting up to 100%) in the text box and when it reaches 100% it will go to frame 10, or which ever you need.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    so there is a bit of java script involved what about just using the code and instead of getting info or going to another page i input geturl("http://www.whatever.com");

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Yes you can tell it something like:

    Code:
    if(percent == 100){
    	gotoAndPlay(getURL("http://whatever.com", "_self"));
    }
    else{
    	gotoAndPlay (1);
    }
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    For an even simpler method:

    2 frames. In the first make a dynamic text box with the var label "myOutput"

    then in the actions layer put this:

    Code:
    var percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
    var myOutput = _root.percent +"% is now Loaded";
    In the 2nd frame make sure the dynamic text box is in the same spot as in the first, and put this in the actions layer:

    Code:
    if(percent == 100){
    	gotoAndPlay(10);
    }
    else{
    	gotoAndPlay (1);
    }
    This will make a text percentile ( 1% counting up to 100%) in the text box and when it reaches 100% it will go to frame 10, or which ever you need.
    Hey! that loader was very useful! but i had some problems:
    What i'm trying to load is a section from a website which has a scrolling text. Without the loader, the text works fine, but when I place the loader at another scene before the actual scrolling text, or at the same scene the text seems to disappear... if i move the loader scene after the text's scene the text works fine..
    I would appreciate any solution for my problem.
    Thanks a lot

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Post your code and I'll take a look. It's hard to say anything from your description alone

  7. #7
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the loader's code is the second choice given by Blizzard.

    the scrolling text is:

    down_btn.onPress = function() {
    textField_txt.scroll += 1;
    };
    up_btn.onPress = function() {
    textField_txt.scroll -= 1;
    };
    stop();

    Thnx a lot

  8. #8
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well.. I fixed it.. the problem was that the dynamic text at the loader wasn't embedded... and i don't know why it affects the scrolling text that was embedded.. but anyway.. it worked xD

Bookmarks

Posting Permissions

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