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.
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.Code:bgLayout = new Layout(currentContainer); bgLayout.minHeight = 600; bgLayout.maintainAspectRatio = true; bgLayout.percentHeight = 1; stageLayout.addChild(bgLayout); stageLayout.draw();
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:
any help is greatly appreciated !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();




Reply With Quote
