I'm not familiar with the Gaia framework, so I'm not sure what some of those function calls (alignSite()) or properties are (__WIDTH).
However all you need to do, is call this on onResize

--
x = int(stage.stageWidth/2 - width/2);
y = int(stage.stageHeight/2 - height/2);
-
Another thing to note, is that width and height will change depending on whats on the stage. If you know that going in you will have stuff that might break the frame (even if masked), you want to use your preset width and height in which case you just call:
--
x = int(stage.stageWidth/ 2 - 1024/2);
y = int(stage.stageHeight/ 2 - 768/2);
---------------

You want to make sure you place the center of the stage to the center of your object (half it's width).

Hope it helps,
http://onedayitwillmake.com

PWMedia | Paul Wolthuis wrote:
Hi there,

I've got a question.

I'm sort of a scriptdummy and having a problem to make a gaia sit fully scalable. To make it clear, i want the full site to scale up or down to the size of the browserwindow and center it horizontal and vertical.

Hope anyone can help me.
Thanks so far!

Paul

------------------

package
{
        import com.gaiaframework.core.GaiaMain;
        
        import flash.display.StageScaleMode;
        import flash.display.StageAlign;
        import flash.events.Event;

        public class Main extends GaiaMain
        {               
                public function Main()
                {
                        super();
                        siteXML = "xml/site.xml";
                }
                override protected function onAddedToStage(event:Event):void
                {
                        stage.align = StageAlign.TOP_LEFT;
                        stage.scaleMode = StageScaleMode.NO_SCALE;
                        alignSite(1024, 768);
                        super.onAddedToStage(event);
                }
                override protected function onResize(event:Event):void
                {
                        view.x = Math.round((stage.stageWidth - __WIDTH) / 2);
                        view.y = Math.round((stage.stageHeight - __HEIGHT) / 2);
                }
        }
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 4261 (20090720) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to