A Flash Developer Resource Site

Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 65

Thread: Preloader hell

  1. #41
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Thankyou
    Yeh tried that and its not quite right so i thought i was doing it wrong, but i'll try again now.

    Also when its uploaded it preloads fine but the fade doesn't work, unless when the image is fully loaded then you clickthrough them and its fine....

  2. #42
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Here is any example of it:

    http://www.alastairsopp.co.uk/scale.html

    The fade only works after you images have loaded once and you go back through.

    At the moment i have crude buttons on it but i would like them ti stay fixed and not scale with the main movie when the window is reszied....
    Not sure how.

    Thanks

  3. #43
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    To get the nav portion not to scale you'll need to apply a resize function to the background image that excludes the nav. So something like,

    PHP Code:
    Stage.align "TL";
    Stage.scaleMode "noScale";

    sizeListener = new Object();
    sizeListener.onResize = function() {
        
    trace(Stage.width);
        
    trace(Stage.height);
        
    picHolder._width Stage.width;
        
    picHolder._height Stage.height;
    }
    Stage.addListener(sizeListener); 
    This will resize the picHolder mc only. Mind you, the proportions to your bitmaps could be distorted depending on the size of the browser window.
    And I have no idea if this is mx compliant. Not too competent with pre Flash 8 code. HTH.
    Wile E. Coyote - "Clear as mud?"

  4. #44
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    OK, figured out how to keep the proportions the same no matter the size of the window, equates to no skewing. Just replace the onResize function and add the function setBackground();. Again, I'm not sure if this is compliant to Flash MX, but at least it's worth a shot.

    PHP Code:
    sizeListener.onResize = function() {
        
    setBackground();
    }

    function 
    setBackground() {
        var 
    startX 0;
        var 
    startY 0;
        
    picHolder._x startX;
        
    picHolder._y startY;
        
    picHolder._width Stage.width;
        
    picHolder._height Stage.height;
        
    picHolder._xscale >  picHolder._yscale picHolder._yscale picHolder._xscale picHolder._xscale picHolder._yscale

    Wile E. Coyote - "Clear as mud?"

  5. #45
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Thanks Robb.
    Nothing happens when i resize the window with that code....

  6. #46
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Quote Originally Posted by Robb@exo
    OK, figured out how to keep the proportions the same no matter the size of the window, equates to no skewing. Just replace the onResize function and add the function setBackground();. Again, I'm not sure if this is compliant to Flash MX, but at least it's worth a shot.

    PHP Code:
    sizeListener.onResize = function() {
        
    setBackground();
    }

    function 
    setBackground() {
        var 
    startX 0;
        var 
    startY 0;
        
    picHolder._x startX;
        
    picHolder._y startY;
        
    picHolder._width Stage.width;
        
    picHolder._height Stage.height;
        
    picHolder._xscale >  picHolder._yscale picHolder._yscale picHolder._xscale picHolder._xscale picHolder._yscale

    Hi

    I'm not sure how to change this code so that it works.
    If i have cs3 will it?
    As i might get it soon.

    Many Thanks

  7. #47
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Yeah it works under cs3 - as2... that's what I have.
    Wile E. Coyote - "Clear as mud?"

  8. #48
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Look as this swf, hopefully it will work for you. Just put it in the folder where your main swf resides (I think it's your root directory).
    Last edited by Robb@exo; 07-31-2009 at 08:14 AM.
    Wile E. Coyote - "Clear as mud?"

  9. #49
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Wow thanks!
    It works great!
    Could you give me the .fla file or would i not be able to edit it as i want to make a couple of tweaks.
    Thanks again

  10. #50
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    The fla file is currently in a version 8 format, so I doubt you'll be able to edit anything with a mx version. And my computer with Flash MX 2004 is out of commission at the moment, so I can't resave it to a legacy version.
    Wile E. Coyote - "Clear as mud?"

  11. #51
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    I have access to cs3 at the moment so that would work yes?

  12. #52
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Yes it should work.
    Last edited by Robb@exo; 07-31-2009 at 08:14 AM.
    Wile E. Coyote - "Clear as mud?"

  13. #53
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Wow thanks for all your help!
    It works great!!!

    I was wondering though. Would it be hard to have a list and when one is clicked it loads an image into the picHolder

  14. #54
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Rather than the NEXT and PREV buttons? If so, then no, you could set it up in a similar manner. But rather the pics being called via a numeric variable, you just assign which button loads which image.
    Wile E. Coyote - "Clear as mud?"

  15. #55
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Yeh do away with the next/prev and have a list of maybe 10 projects i have.
    Then when one clicked it loads into the picHolder behind.
    So the text is still overlayed.

    I guess i need to change this bit?
    Code:
    var pathToPics= "images/";
    var pArray = ["0.jpg", "1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg" ];
    var pIndex = 0;
    var fadeSpeed = 10;
    var total = pArray.length;
    var p = 0;
    
    loadMovie(pathToPics+pArray[0], picHolder);
    
    this.onEnterFrame = function() {
    	filesize = Math.round(picHolder.getBytesTotal());
    	loaded = Math.round(picHolder.getBytesLoaded());
    	preloader._visible = true;
    	if (loaded < filesize) {
    		preloader._xscale = 100 * loaded / filesize;
    	} else {
    		preloader._visible = false;
    		if (picHolder._alpha < 100) {
    			picHolder._alpha += 10;
    		}
    	}
    };
    Not sure how.
    No dramas if not, its great as it is.
    Just a thought

  16. #56
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Quote Originally Posted by Robb@exo
    But rather the pics being called via a numeric variable, you just assign which button loads which image.
    Could you help me with this bit?

  17. #57
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Also im trying to change the position of the picHolder.
    At the moment its set to x and y = 0
    Is there any way to have it set to 'LM' ?
    As that helps lots with centering the image so that bottom isn't chopped off in widescreen monitor/browser setups.
    Thanks

  18. #58
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    What's LM? Were you referring to this?
    http://www.adobe.com/livedocs/flash/...=00002690.html
    Wile E. Coyote - "Clear as mud?"

  19. #59
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Here's a new file with a list style nav. It's a F[8] version not MX, didn't have time to figure it out.
    Last edited by Robb@exo; 03-01-2010 at 11:41 AM.
    Wile E. Coyote - "Clear as mud?"

  20. #60
    Senior Member
    Join Date
    Jun 2005
    Posts
    143
    Wow thanks.
    I love that list of projects.

    When the window is dragged in the quality degrades quite a bit though....

    Is there a way of setting it position to 'L' and not '0'?

    Code:
    function setBackground() {
    	var startX = 0;
    	var startY = 0;
    	picHolder._x = startX;
    	picHolder._y = startY;
    	picHolder._width = Stage.width;
    	picHolder._height = Stage.height;
    	picHolder._xscale >  picHolder._yscale ? picHolder._yscale = picHolder._xscale : picHolder._xscale = picHolder._yscale; 
    }

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