A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: simple pre loader?

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    4
    ok heres the deal
    i have made my first flash inclusive web site
    (http://home.iprimus.com.au/naac/TUSKEN/)
    it has a faily interactive menu which loads in a frame on the left which has a soudtrack in it so it takes a while to load.

    to show the viewer that it's loading i made a small flash movie that says loading and made it open in the right frame and the when in the menu movie i made an action that makes the intro page open when the left menu page has loaded.
    so:
    'left menu' loads in left frame
    'loading movie' opens in right frame
    when 'left menu' loads,
    'intro.html' opens in the right frame

    this is effictively a pre-loader

    but it isnt very professional.
    i only did it cos i dont know how to make preloaders within my movies (or .fla's) themselves...

    but this operation has issues with using the browser to press forwar and back etc so its really dodgy!!!

    All i need is the knowledge of how to make my swf files play a small movie symbol until the whole thing has loaded...

    how???
    help???
    please???

    if you dont know what my problem is check out my site and see...
    its pretty cool.
    check it out
    http://home.iprimus.com.au/naac/TUSKEN/

    thanks
    nathan

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    221
    you mean a preloader in a swf file well ..

    put only this on frame 1 ->
    Code:
    
    init = false;
    
    onEnterFrame = function(){
    	loadedBytes = _root.getBytesLoaded();
    	if (loadedBytes>0) {
    		if (!init) {
    			totalBytes =  _root.getBytesTotal()
    			init=true
    		}
    		percentage=Math.floor(loadedBytes/totalBytes*100);
     		trace(percentage)		
    		if(percentage==100) {
    			onEnterFrame = null;
    			finishPreload()
    		}
    	} 
      	else {
    		percentage=0
    	}
     }
    
    finishPreload = function (){
    	gotoAndStop("Finish")
    	
    }
    
    stop();
    this will calculate how much is loaded in percentage and when loaded goto frame Finish

    succes

    Nyls

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    221
    OK .. here what to do to see it work :

    make a new movie

    paste the code on frame 1 >> no artwork on frame 1 >> make a frame with label Finish ... maybe 10

    OK dump on a frame (11) a lot of pictures ? to have some body ...
    then press: ctrl + enter (for preview)
    again press: ctrl + enter (to show streaming over the internet)

    If it's OK you should see percentages in you're output dialog >> whenit's finished eq. 100 it jumps to frame finished!

    (It's also OK to put on view > Bandwith Proviler so you can see how the streaming is going)

    Nyls

    ps when you reply to this post I get an email .. so you don't have to mail me directly!!


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