OK I figured it out. Basically verticalalign and horizontal align are for the children of the class not the class itself, which was what was throwing me off.
So I created a custom component based on the box, as the other poster said, THEN I placed inside the box element a panel, which contained my login labels, and input text boxes etc. In the viewstack when I instantiated my box element, I set it up with vertical and horizontal alignments so that the PANEL inside it showed up in the middle. Also the boxs' width and hieght were both 100% of the viewstack. For future reference. Thanks to all who helped. --- In [email protected], "Shaun" <[EMAIL PROTECTED]> wrote: > > a couple of options: > > 1) change your login control to a popup titlewindow instead and use > popupmanager to center it to the viewstack > 2) put your login control in a <mx:Box> control that takes up the > full size of the viewstack and has verticalAlign set to middle and > horizontalAlign set to center. > > Shaun > > --- In [email protected], "cardinalflexjeremy" > <sandersjs@> wrote: > > > > I have a viewstack, that contains two sub components. One (the > first) > > is simply a small login panel. (its actually just a canvas with text > > fields and a header etc inside it). The second is what is shown once > > the user is logged in; its also a large canvas, with a function app > > inside that component. > > > > So my code looks like this: > > > > <mx:ViewStack width="800" height="600" maxHeight="600" > maxWidth="800" > > selectedChild="{getView(false)}" id="myViewStack"> > > <view:LoggedInView id="LoggedInView" /> > > <view:loginPanel id="LoginView" /> > > > > </mx:ViewStack> > > > > So I want to have the loginPanel displayed in the center of the > > available real estate, regardless of screen real estate, (some > viewers > > might be 1024x 768 and some might be 800 x 600) is there anyway to > > automatically center the loginPanel component in the parent view > stack? > > > > Thanks > > JS > > >

