A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: preloader in a movie clip

  1. #1
    Junior Member
    Join Date
    May 2003
    Location
    manchester, england
    Posts
    9

    preloader in a movie clip

    I have a preloader in my main movie which works fine, but what I need to do is change the code so that it works in a movie clip loaded into the main movie.
    Here's the code.


    bytes_loaded = Math.round(_root.getBytesLoaded());
    bytes_total = Math.round(_root.getBytesTotal());
    getPercent = bytes_loaded/bytes_total;
    _root.loadBar._width = getPercent*210;
    _root.loadTextPercentage = "Loading Navigation";
    _root.loadText = Math.round(getPercent*100)+"%";
    _root.Percentage = "of 120kb";
    if (bytes_loaded == bytes_total) {
    _root.gotoAndPlay(3);
    }

    Any help on this suject would be gratefully appreciated.

  2. #2
    Member
    Join Date
    Jul 2003
    Posts
    31
    loadedbytes = getbytesloaded();
    totalbytes = getbytestotal();
    percentbytes = int(loadedbytes/(totalbytes/100));
    telltarget(_root.loader);
    gotoAndStop(_root.percentbytes);

    Use that and name your movie clip "loader" or whatever you want

    also, if you're telling a movie clip to change frames and the code is IN the movie clip "this" works instead of _root.fkjshdf

    then, on the second frame in the main timeline, give it this:
    if (loadedbytes == totalbytes) {
    nextScene();
    } else {
    gotoAndPlay(1);
    }

    i hope i 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