All you have to do is set the horizontalCenter=0 and verticalCenter=0 on the
outermost component (except Canvas) in your application. For example,
 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout=absolute>
  <mx:Canvas width=100% height=100%>
    <mx:TitleWindow width=700 height=450 horizontalCenter=0 verticalCenter=0
title="My Window">
    </mx:TitleWindow>
  </mx:Canvas>
<mx:Application>
 
This will center the title window on your screen.
 
HTH,
Randy


   _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of javaguru_uk
Sent: Friday, December 28, 2007 3:32 AM
To: [email protected]
Subject: [flexcoders] Re: Centering an Application



--- In HYPERLINK
"mailto:flexcoders%40yahoogroups.com"[EMAIL PROTECTED], Frederico
Garcia <[EMAIL PROTECTED]>
wrote:

> Have a VBox as the top level container
(top=0;bottom=-0;left=0;-right=0). 
> Insert one empty Canvas, then an HBox, then another empty Canvas. The 
> two Canvas' having width and height of 100% and the HBox the same
height 
> as your "Application Canvas". Now, inside the Hbox have one empty 
> canvas, your "Application Canvas" and finally another empty canvas. The 
> empty Canvas' with width=100% and height=100%;
> 
> The outline tree would look like:
> 
> Applicaton
> |-- VBox
> |-- Canvas top
> |-- HBox
> | |-- Canvas centerLeft
> | |-- Canvas main
> | |-- Canvas centerRight
> |-- Canvas bottom
> 
> I'd only advise you to do this if you want alot of flexibility in your 
> layout. (I did this for HYPERLINK
"http://www.sizemodels.com"http://www.sizemode-ls.com)
> 
> For the most cases it would be enough to have all your content inside a 
> Canvas, and set it's verticalCenter = 0 and horizontalCenter = 0.
>

Hi Garcia,

Thanks a lot for the tip. Muito obrigado mesmo.

I will give it a try. But that is a hell of a lot work for a simple
solution. :D 

Fidel.



 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.516 / Virus Database: 269.17.11/1200 - Release Date: 12/27/2007
1:34 PM
 

Reply via email to