tags:

views:

38

answers:

1

Hi,

I would like to base one component's x and y cooridnates according to another, I tried using the binding notation but it doesn't seem to work!

<?xml version="1.0" encoding="utf-8"?>
<s:VGroup   xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            xmlns:vld ="com.lal.validators.*"
            xmlns:effect="com.lal.effects.*" 
            xmlns:components="com.lal.components.*"
            width="400" height="100%"
            right="0"
            horizontalAlign="right"
            verticalCenter="0">
......  

    <s:VGroup
        width="125"
        height="100%"
        horizontalAlign="right"
        gap="0"  width.normal="153" x.normal="247" width.expanded="199" x.expanded="201">

        ......

        <s:Panel includeIn="expanded" id="buttonsGroup"           
                 mouseOut="changeStateToNormal();"
                 mouseOver="stopChangeToNormal();"
                 skinClass="com.lal.skins.TitlelessPanel"
                 title="hi"
                 right="0"
                 width="125" height="700" >
            .....
            <s:Label text="Jump To Date" paddingTop="20" />
            <s:TextInput id="wholeDate" width="100"  
                         mouseOver="stopChangeToNormal();"
                         click="date1.visible = true"
                         focusOut="date1.visible = false"/>
            ...
        </s:Panel>
    </s:VGroup>
    <mx:DateChooser id="date1" 
                    change="useDate(event); this.visible = false; " 
                    visible="false"  
                    mouseOver="stopChangeToNormal();" 
                    y="{wholeDate.y}"
                    x="{wholeDate.x}" />    
</s:VGroup> 
+1  A: 

I believe your problem is due to the container types you are using. You can only specify arbitrary X and Y co-ordinates for views when their parent container uses absolute layout, such as a Canvas. The VGroup has its own ideas about where it's going to put its children. If you want arbitrary control over the position of child components, use an absolute layout.

lach
Thanks lach...You were right all I had to do to change the s:VGroup to s:SkinnableContainer and it worked!
Tam