A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: oh, no, preloader is not working properly...why?

  1. #1
    Member
    Join Date
    Oct 2001
    Posts
    50
    hi everyone
    i am facing aproblem making a preloader
    I have followed this tutorial
    http://www.dissymmetry.com/tutorials/preloader.html

    but the problem is that the bar works well untill about 5 percent and then doesn't jump to 100% , i mean before it loads it goes to the next scene....

    I just made everything they did 'but' i changed something in the code coz i have 2 scenes while i have only one scene.
    this is my code:
    "initialize section"

    Set Variable: "NumberOfScenes" = 3
    // Variable = String, Value = Expr.
    Set Variable: "iCount" = 0
    // Variable = String, Value = Expr.
    Loop While (iCount < NumberOfScenes)
    // Condition = Expr.

    Set Variable: "TotalFrames" = TotalFrames + GetProperty("_level" & iCount, _totalframes)
    // Variable = String, Value = Expr.
    Set Variable: "iCount" = iCount + 1
    // Variable = String, Value = Expr.
    End Loop
    Set Variable: "iCount" = 0
    // Variable = String, Value = Expr.



    progress section

    Set Variable: "FramesLoaded" = 0
    // Variable = String, Value = Expr.
    Loop While (iCount < NumberOfScenes)
    // Condition = Expr.
    Comment: Loop totals the number of frames loaded from all scenes in the movie into the variable FramesLoaded
    Set Variable: "FramesLoaded" = FramesLoaded + GetProperty("_level" & iCount, _framesloaded)
    // Variable = String, Value =Expr.
    Set Variable: "iCount" = iCount + 1
    // Variable = String, Value = Expr.
    End Loop

    Set Variable: "Progress" = Int (FramesLoaded * 100 / TotalFrames)
    // Variable = String, Value = Expr.

    Set Variable: "iCount" = 0
    // Variable = String, Value = Expr.


    loop section

    If (Progress <100)
    Begin Tell Target ("/PreloaderBar")
    // Target = String
    Go to and Stop (../:Progress)
    // Expression = Expr.
    End Tell Target
    Go to and Play ("Progress")
    // The second frame label
    Else
    Begin Tell Target ("/PreloaderBAr")
    // Expression = Expr.
    Go to and Stop (100)
    End Tell Target
    Go to and Play ("Change")
    // The final frame label
    End If



    & finally the change section
    nextScene ();
    can any one help?
    plz,
    i appreciate any help



  2. #2
    Oh my god , talk about overkill. If you're using Flash 5 I can send you a preloader that's about 1/5 the size and not nearly as complicated.

  3. #3
    Member
    Join Date
    Oct 2001
    Posts
    50
    yup um using flash 5
    plz, send my the file, i need such a thing
    but, the most of important thing is that it has a preloader bar that grow according to the loaded percentage. Do u have it?
    thanks so much for the reply

  4. #4
    Member
    Join Date
    Oct 2001
    Posts
    50
    hmmm...
    it seem you forgot about me
    any one else can help?
    thanks in advance

  5. #5
    Member
    Join Date
    Nov 2001
    Posts
    61

    Try the preloader tuts on this site...

    They are really easy to follow with like 4 lines of code. There is like 5-10 of them, for beginners and experts, remember though, the preloader won't work unless it is posted on the internet, it will not work if it just tested on your own comp, try posting on entertainmail.net, then you can see if it is working.

    Jason

  6. #6
    Member
    Join Date
    Oct 2001
    Posts
    50
    thanks dear for the help...
    actually i have put it on the internet but it does not work..!! there is an error for sure.
    i followed several tutorials, some of them too hard, some of them intermediate level and it worked but it is not the style that i want...i want that style in the link i have put above...so,,i need example i guess, a simple flash file that i can follow...
    well, thanks so much for your reply
    take care

  7. #7
    Member
    Join Date
    Dec 2001
    Posts
    32

    Nice percentage Preloader

    This preloader sounds like what you need; it will accurately move from 1% to 100% according to how much of the movie is loaded.

    To make a preloader with a percentage bar....

    Set up 3 different layers and name them:
    Display Variables
    Control Commands
    Loader Bar

    In that order.

    Now create a Movie Clip, and call it loader.

    Make up some kind of animation, say a sliding bar that lasts 100 frames. (Use a mask for the bar)
    where at frame 0, nothing has happened, and frame 100 is when all the frames are loaded.

    Put this movie clip onto the stage on the Loader Bar layer, and give it the instance name 'loader'.

    On the control layer, put the following commands in the 2nd frame:

    loadedbytes=getBytesLoaded();
    totalbytes=getBytesTotal();
    loadedkbytes=Math.ceil (loadedbytes/1000);
    totalkbytes=Math.ceil(totalbytes/1000);
    if (loadedbytes == totalbytes) {
    nextScene ();
    }

    frame = int(loadedbytes/(totalbytes/100));
    tellTarget (_root.loader) {
    gotoAndStop (_root.frame);
    }

    In the 3rd fram on the same layer, add a loop to go back to the start of the movie.

    Email if you have any problem or need more help.

    Good luck

    Carl

  8. #8
    Member
    Join Date
    Dec 2001
    Posts
    32

    Testing It!!!

    It says above that you can't test it on your own machine, but you can. Simply click Test Movie, and then in the menu at the top, click on View Streaming. This will simulate various internet speeds. To change the speed that you are testing, click Debug, and change there.

    Again, good luck

  9. #9
    Sorry, I was out of town.
    I've got the preloader source file to send if you'd like. Just email me at
    sprocky@sprocklander.com

  10. #10
    Member
    Join Date
    Oct 2001
    Posts
    50
    carl, thanks so so much for the help
    I am busy these days, i'll try ur help later on, and if i find any difficuilties,i'll post my questions here
    thanks again , ur help is highly appreciated.

    hello sprocky
    how are you?
    well, thanks so much, i'll send you e-mail right now.
    take care

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