A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Senocuar's Layout Class issue, scaling image on resize

Threaded View

  1. #1
    Member
    Join Date
    Jul 2009
    Location
    Florianópolis
    Posts
    81

    Senocuar's Layout Class issue, scaling image on resize

    i've been running into weird problems regarding Senocular's Layout Class. It's a nice little framework to align and scale objects in a fluid layout, though.

    Some images in the background (currentContainer) don't resize all the way to fit stage's height, and sometimes they get really small in a corner.

    Code:
    bgLayout = new Layout(currentContainer);
    			bgLayout.minHeight = 600;
    			bgLayout.maintainAspectRatio = true;
    			bgLayout.percentHeight = 1;
    			
    			stageLayout.addChild(bgLayout);
    			stageLayout.draw();
    each time the currentContainer mc gets a different bitmap images (with varying dimensions) on it, it gets assigned to bgLayout , whis is added to the stageLayout.

    actually, do I need to do that ? Or maybe I should remove bgLayout from stageLayout before assigning it again?

    Which are the best practices here?

    Does anybody knows a class that do this job ?

    Here is the context in which the code above finds itself:

    Code:
    private function onBackgroundLoaded(e:Event):void
    		{
    
    			switchContainers();
    			
    			loader.getBitmap("bg").smoothing = true;
    			currentContainer.addChild(loader.getBitmap("bg"));
    
    			bgLayout = new Layout(currentContainer);
    			bgLayout.minHeight = 600;
    			bgLayout.maintainAspectRatio = true;
    			bgLayout.percentHeight = 1;
    
    			stageLayout.addChild(bgLayout);
    			stageLayout.draw();
    			
    			TweenLite.to(currentContainer, 0.3, {alpha:1});
    			TweenLite.to(otherContainer, 0.3, {alpha:0, onComplete: cleanContainer});
    			
    			loader.removeAll();
    any help is greatly appreciated !
    Last edited by ziriguidum; 04-08-2010 at 08:37 AM.

Tags for this Thread

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