A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: preloader

  1. #1
    Senior Member
    Join Date
    Sep 2002
    Posts
    106

    preloader

    Can someone help me with this actionscript for a preloader ?
    Attached Files Attached Files
    www.flashflow.be

  2. #2
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Wht not use the koolmoves already built in preloader?
    movie>>loading message?
    Any programming language is at its best before it is implemented and used.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Remus is the preloader expert. When he returns from vacation, he can figure it out.

  4. #4
    Senior Member
    Join Date
    Sep 2002
    Posts
    106
    Thanks Bob, can you notify me when he's back.
    www.flashflow.be

  5. #5
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Take a look at this site for some guidance:
    http://www.bokelberg.de/actionscript/

    Hilary

    --

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Preloaders are pretty simple. All you need to do is compare either the framesloaded to the totalframes or you can use the getbytesloaded and compare it to totalbytes.

    Either one is aceptable.

    The trick is to not use frame 0. You can also use it to check a loaded movie- loaded into a level or movie clip.

    Anyhow the way to do it is this;

    On your second or third frame, make sure its after your preloader. You will add this script to the frame.

    total= _root._totalframes;
    loaded=_root._framesloaded;
    if(loaded != total)
    {
    GotoandPlay(0);
    }

    you could switch this by comparing bytes if you wish by replacing _totalframes and _framesloaded getbytestotal() and getbytesloaded().

  7. #7
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Okay, I looked at your file. It has some serious problems.

    One of them is that in your MC you have tweens set to 6 instead of to 0. This means that key frame 2 is actaully frame 6 and key frame 3 is actually 12.

    Second on key frame 16 your AS is

    vavar total = _root.getBytesTotal ();
    var loaded = _root.getBytesLoaded ();
    var procent = (100/total)*loaded ;
    if (procent >= 100) {
    _root.gotoAndPlay ("main");
    }

    Notice that you mistyped var ** Note ** you do not need to type var when declaring a local variable but rather just the name of it. Varvar is the name of the variable as it is not restricyed. fix the typo.

    Set the tweens to 0 and fix your typo and it works.

    I wouldn't have constructed it like this though- There is an easier way to acomplish this.

  8. #8
    Senior Member
    Join Date
    Sep 2002
    Posts
    106
    Thanks for the help.


    Now I can also animate the loading part and
    tell how much there is to load of the total.
    www.flashflow.be

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