Nope, you need to set those properties on Panel (Children of Canvas). When you set horizontalCenter and verticalCenter to 0 on Panel, it positions itself at the exact center. Now, if you have another panel which you want to display at 100, 100 center offset then you can set horizontalCenter and verticalCenter to 100.

 

For eg:

<mx:Canvas backgroundColor="blue" width="100%" height="100%">

                        <mx:Panel horizontalCenter="0" verticalCenter="0" width="100" height="100"/>

                       

                        <mx:Panel horizontalCenter="100" verticalCenter="100" width="100" height="100"/>                     

            </mx:Canvas>

 

Hope this will clear your concern.

 

-Ashish

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of joshuajnoble
Sent: Tuesday, September 26, 2006 8:50 AM
To: [email protected]
Subject: [flexcoders] Re: Viewstack with canvas + centered panel

 


I think you mean: "To get the Panel centered on the stage (Canvas),
set horizontalCenter and verticalCenter properties on the Canvas to
0." Setting those props on the Panel will only affect children inside
the Panel.

--- In [EMAIL PROTECTED]ups.com, "Ashish Goyal" <[EMAIL PROTECTED]> wrote:
>
> To stretch the Canvas you can set the width and height to 100%.
>
>
>
> To get the Panel centered on the stage (Canvas), set horizontalCenter
> and verticalCenter properties on the Panel to 0. These are constrained
> based layout properties and they work only if the component is a child
> of Canvas as in your case.
>
>
>
> -Ashish
>
>
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of Jeroen Beckers
> Sent: Monday, September 25, 2006 1:13 PM
> To: flexcoders
> Subject: [flexcoders] Viewstack with canvas + centered panel
>
>
>
> Hi,
>
> I'm fairly new to Flex, but I have been developing in Flash for some
> years now. The reason why I mailed you guys is that I'm having trouble
> with the viewstack component...
>
> This is what I want:
>
> -viewstack
> -Canvas
> -Panel
>
> The Canvas has to cover the entire stage and the Panel has to be
> centered on the stage (both vertically as horizontally).
>
> Could anyone give me a push in the right direction? Maybe a little mxml
> or something ?
>
> I can get a canvas + panel into a viewstack, but I really can't figure
> out how to center the panel and 'stretch' the canvas ...
>
> Greets,
> Jeroen Beckers
> [EMAIL PROTECTED] <mailto:info%40dauntless.be>
> http://www.dauntless.be <http://www.dauntless.be>
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to