javaguru_uk escreveu:
> Hello Folks!
>
> Hope you guys have had a nice christmas.
>
> I am trying to solve something I hope you guys can help me with. I
> have looked all over the web and did not find any answer.
>
> What I want is to center my Application Canvas. So, if I maximize the
> application window (if using adobe air) or the browser (if using
> flex), the Canvas is always at the center.
>
> Can someone give me some hints? I have tried the horizontalAlign and
> verticalAlign, which I thought would solve my problem.
>
> I have opened the generated swf with the Flash Player and when I
> maximize the Flash Player, my Canvas stays at the top left corner. I
> would like to center it.
>
> Thanks in advance,
>
> Fidel.
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
>
>
>
>
> __________ NOD32 2749 (20071227) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
>
>   
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 http://www.sizemodels.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.

Reply via email to