A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How do I get rid of pre loader bar when page loaded?

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    3

    How do I get rid of pre loader bar when page loaded?

    Ok why wont this work? (flash CS5 and action script 2)

    Trying to do a

    Navigation bar button , to preloader to abour me page with a photo component.

    Not on the pre loader page the bar works, only it wont disappear.

    siteLoader.loadMovie("AboutMe5.swf",4);


    Frame_movie._alpha = 100;
    loadingBar._alpha = 100;


    loadingBar._xscale = 1;

    loadingBar.onEnterFrame = function()
    {
    kBytesLoaded = this._parent.siteLoader.getBytesLoaded() / 1024;
    kBytesTotal = this._parent.siteLoader.getBytesTotal() / 1024;
    percentage = Math.round(kBytesLoaded / kBytesTotal * 100);
    this._xscale = percentage;

    if ("percentage" ==99) {


    loadingBar._alpha=0;
    Frame_movie._alpha=0;

    delete this.onEnterFrame;
    }

    }



    The nav bar has the following script

    Button_AboutMe.onRelease = function(){
    unloadMovie(4);
    loadMovie("AboutMe_Loader.swf",4);
    }




    The loaded film used to just have as the script

    stop();

    now I added this script to the final AboutMe5.swf file to try and hide the bar but does not work, also tried using different layers and the unloadMovie(4); script. It did not work.



    unloadMovie(4);
    loadingBar._alpha=25;
    Frame_movie._alpha=25;

    SiteLoader._alpha = 10
    // loadingBar._alpha=1;
    // this._alpha=1;
    //Frame_movie._alpha=1;



    Now Frame_move is a mov (and tried button) and the laoding bar is a mov file. I can make these fade by adusting the alpah but this only works accross the film. I cannot trigger it with the line.



    if ("percentage" ==99) {



    Ive tried with and without single and double quotes. and plane.

    tried replacing percentage with

    this._xscale
    loading bar


    Nothing works.

    it appears to be the if script thats the problem not triggering the fad or gettig red of the pre loader altogether.


    Please help


    Also tried

    if (percentage >=99) {

    it says syntax error

  2. #2
    Junior Member
    Join Date
    Aug 2010
    Posts
    3

    here is attached flash file

    also the website is www.chriscreativity.com
    Attached Files Attached Files

  3. #3
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Change this:

    Actionscript Code:
    if ("percentage" == 75) {

       
            loadingBar._alpha=0;
            Frame_movie._alpha=0;
       
            delete this.onEnterFrame;
        }

    to THIS:

    Actionscript Code:
    if (percentage == 100) {

       
            unloadMovie(loadingBar);
            unloadMovie(Frame_movie);
       
            delete this.onEnterFrame;
        }

    Reason being that, when you have quotes around something, it turns into a string, it won't then look for the variable with the percentage value, and why did you check if it was equals to 75? When the loader had loaded the content, its value increases to 100, which means the content has been 100% loaded. And you don't need to change the alpha of the movieclips, you can just remove them and free memory
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

Tags for this Thread

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