Hi,

You can get the width/height of root element using width/height variable
in the same file(scope). 

Assuming Canvas is root element of LoginView.mxml:

<mx:Canvas width="600" height="600"
xmlns:mx="http://www.macromedia.com/2003/mxml";>
    <mx:Panel id="AOPScheduler" title="Login" dropShadow="true"
x="{width/2} "/>
</mx:Canvas>


-abdul



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Morphis
Sent: Thursday, October 13, 2005 1:26 PM
To: [email protected]
Subject: [flexcoders] centering a form....

I'm trying to center a form within a Canvas which is within a Panel.
We're using multiple MXML files. I've got a loginView.mxml file and a
main.mxml files.
On the main.mxml file we use a panel and a viewstack to display the
login and main views.
Within the loginView.mxml page we have a Canvas, Panel and Form.
I'm needing to center the Panel within the Canvas on the same file or
utilize a control from the main.mxml file.
I've tried to put the id field in the canvas but get errors...
Error /com/alltel/rapid/aopscheduler/view/LoginView.mxml:6
id is not allowed on root node

Is this possible to get the width of one of the other controls to use?
I was thinking something like..
<mx:Panel id="AOPScheduler" title="Login" dropShadow="true" x=" {
main.mainPanel.width - AOPScheduler.width  / 2 } ">

and then repeating the process for height for the y attribute.

Thanks!

--
Auxilium meum a Domino



--
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



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to