A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: simple preloader

  1. #1
    Huygens to Titan PCRIDE's Avatar
    Join Date
    May 2002
    Location
    PLUTO
    Posts
    1,335

    Lightbulb

    Ok I need to build a simple preloader, all of the sites I have looked at are all differnt. So here is my question, I need a very simple preloader I made one awhile ago and it worked it was three frames (if frame is loaded) goto frame100 (main movie) second frame was goto and play1 (for the preloader)I just upgraded to Flash MX I donn't think it is too differnt. If some one could refreash my memory so I can get this site going that I am trying to build \that would be great!. Maybe you could point me in a direction of a link or something or cut and paste me an example.
    Thanks PCRIDE

  2. #2
    Friendly fire ain't. skd's Avatar
    Join Date
    Mar 2002
    Location
    toronto.ca
    Posts
    389
    One solution would be this:
    a. create an empty keyframe in frame 1 of your movie
    b. put stop() action in that first keyframe
    c. create a dummy movie clip in that frame
    d. put the following code in the clip
    Code:
    onClipEvent (enterFrame) {
    bytesL = _root.getBytesLoaded();
    bytesT = _root.getBytesTotal();
    percentL = math.ceil(bytesL/bytesT * 100);
    if (percentL >= 100) {
    _root.gotoAndPlay(100);
    }
    This should preload your movie and send the playhead to frame 100 when done. With such preloader, you can start your content right from frame 2.

  3. #3
    Huygens to Titan PCRIDE's Avatar
    Join Date
    May 2002
    Location
    PLUTO
    Posts
    1,335
    Thanks for your reply, I was confused a little. Do I use a seprate layer just fot the script. I tried it and I get a synax error on line 7 and 8. Do I need to edit the frame number in the script. What I am doing is puting the (stop) action and the script in one frame on the MC layer
    Thanks PCRIDE



    any help would help me tremendously as I am trying to pursue a carear in graphic design multimedia.


  4. #4
    Friendly fire ain't. skd's Avatar
    Join Date
    Mar 2002
    Location
    toronto.ca
    Posts
    389
    That script does not go into a layer, but rather in the movie clip instance on the first frame of your movie.

    The script that goes into the frame is only the stop() action (it goes into the same keyframe as the movie clip in which the preload script is).

    You need to alter the frame number - in the _root.gotoAndPlay(x), x must be the keyframe on which your content starts.

    Hope that helped.

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