How can I make this simple state & transition work? Each layout works on it's own, but not when combined as a state, although I can get it to work if I put in pixel values, but not using percentages for the HDividedBox child containers width properties.

I am also wondering why the HBox container is filling up the whole screen instead of staying at width="40%"?

Sorry if this is a little basic, I am just trying wrap my head around all the layout/state/transition intricacies...

Thanks, Kevin


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
<mx:states>
        <mx:State name="state1">
                <mx:AddChild relativeTo="{hdivbox1}" position="lastChild">
                        <mx:Panel height="90%" width="60%" title="Panel 2" 
id="panel2"/>
                </mx:AddChild>
        </mx:State>
</mx:states>
<mx:transitions>
        <mx:Transition id="myTrans" fromState="*" toState="state1" >
                <mx:Resize duration="1000" />
        </mx:Transition>
</mx:transitions>

<mx:HDividedBox id="hdivbox1" height="100%" width="100%" horizontalAlign="center">
        
<mx:HBox id="panel1" height="100%" width="40%" horizontalAlign="center">
                <mx:Panel height="100%" width="100%" title="Panel 1">
<mx:Button id="clickme" label="Click For Transition" click="currentState='state1'" />
                </mx:Panel>
        </mx:HBox>        
        
</mx:HDividedBox>
</mx:Application>

Reply via email to