A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Preloanding but not all movie. Pls help me!

  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    Brazil
    Posts
    9

    Preloanding but not all movie. Pls help me!

    Hi,

    I am new to action scripting and any help would be much appreciated.

    I am building a preloader and things are ok if I preload the entire movie. But, when I try to make a preloader that preloads only a small part of my timeline, I just get myself lost.

    Ive tried this for the preloader that preloads all movie:
    totalBytes = _root.getBytesTotal();
    (and as I said, it works)

    But... when I substitute the _root.(myMovieClip instance name)getBytesTotal();
    It doesnt work!

    Anyone would be gentle enough to tell me what am I doing wrong?

    Thank You!

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can not use getBytesLoaded to see if a movieClip is loaded, as Flash can only target things that are already loaded.
    You can on the other hand preload frames and use....

    if(_root._framesloaded > 12){
    //Do something
    }

    ...will check if frame number 12 is loaded ( where the target may be ).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    May 2001
    Location
    Brazil
    Posts
    9
    Hi pellepiano,

    Thank you for you repply.

    Well, I guess I wasn't able to express myself so, I pasted here all the code Ive wrote:

    totalBytes = _root.getBytesTotal();
    loadedBytes = _root.getBytesLoaded();
    remainingBytes = totalBytes - loadedBytes
    percentDone = int((loadedBytes/totalBytes)*100);
    bar.gotoAndStop(percentDone);
    ifFrameLoaded ("mermaids") {
    gotoAndStop("intro");
    }

    This code works when I am loading all movie but, I need it works and displays percent done and etc, when my "mermaids" movie clip has loaded.

    I still dont know how to do it, pls help me!

    thanks

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Just make dynamic textfields with the variable names of the variables in the script to display the values.

    ...or I still dont get what you want?

    Is some part of the code not working?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    May 2001
    Location
    Brazil
    Posts
    9
    Hi, you are fast!

    Thanks a lot for helping me.

    But, it is not about displaying the values...

    The part of the code that is not working is that I need this "preload display" to count the bytes until my specific movieclip has loaded.

    I can get it working properly (when I use this code for preload all timeline) but I am not able to make the preload count the bytes loaded at this specific point.

    I just dont know how to write this. How to tell to flash that I need it to count the bytes, and display the values for this specific movie clip in my timeline.

    Ive tried to use a frame label, a frame number or my movie clip name instead of _root. But I still cant get it working.

    Thank you...

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    It is not possible to show the loading process for a movieclip, as I stated in the earlier post. You can just check when the frame its sitting on is loaded.
    The closest you can get is to compare the number of frames loaded to the framenumber of the movieclip and do a percentage calculation of that.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #7
    Junior Member
    Join Date
    May 2001
    Location
    Brazil
    Posts
    9
    Oh,

    Thanks for your help pellepiano. Now I begin to understand what is going wrong with my code. I will make some changes in it.

    Again, thanks a lot.

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