Welcome, Guest
  • Author Topic: Help with preloader for Simple Photo Gallery 2.0  (Read 3756 times)

    Brendon

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Ilha Quisiva
    Hi Guys,

    I have been trying to understand and modify the "simple photo gallery 2" which I found on Flash DB. I have made some major changes, like cross-fading instead of blur, and added thumbnail selection (not too successfully I must admit), and now I am trying to add a preloader function for each new photo.
    Can anyone help me with this topic as my knowledge of classes and more advanced as 2.0 is very limited? I can't seem to figure out how to integrate the preloader into the existing classes or AS files.

    http://www.flash-db.com/Tutorials/simplegallery/

    Thanks.
    Brendon
    « Last Edit: 08/27/07, 08:36 by Brendon »

    papachan

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: Help with preloader for Simple Photo Gallery 2.0
    « Reply #1 on: 08/27/07, 09:25 »
    in fotogallery.as you have the MovieClipLoader object.
    so you can add a private method there...
    like this one:


            
    private var preload_mc:MovieClip // a movieclip on the movieclip you need to instance it before use it
    	
    private function 
    onLoadProgress (target:MovieClipbytesLoaded:NumberbytesTotal:Number) {
    	
    	
    	
    target._visible false // if you want your image invisible
    	
    	
    	
    var 
    p:Number Math.round(bytesLoaded/bytesTotal*100);
    	
    	
    	
    preload_mc.percent_txt.text = (String(p).substr(1)==undefined)? "0"+p;
    	
    	
    	
    preload_mc.percent_txt.text += " %"
    	
    	
    	
    preload_mc.bar._xscale p;// a bar progress
    	
    }



    i hope it help you !


    Brendon

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Ilha Quisiva
    Re: Help with preloader for Simple Photo Gallery 2.0
    « Reply #2 on: 08/27/07, 16:40 »
    Thanks alot Papachan! That worked perfectly. I am really stoked!

    All I need to do now is improve the way my thumbnails intercept the slideshow as there is a delay of one whole slide plus the loading times, after the user clicks the thumbnails and before they see the slide they selected. I will give it my best shot first, but I might have to bug you again later, if you don't mind.

    Take care.
    Brendon