Hi there,

 

I was using states to introduce a controlBar inside a panel but once I
switch states, my buttons are not positioned correctly but somewhere else. 

 

Here is a small code to reproduce the problem. This code was generated with
design view.

If you click on the first button to switch states, you’ll see that the
control bar is not positioned at the bottom of the panel.

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">

                <mx:states>

                               <mx:State name="newstate">

                                               <mx:SetStyle
target="{panel1}" name="top" value="331"/>

                                               <mx:AddChild
position="lastChild">

                                                               <mx:Panel
height="283" layout="absolute" top="40" left="10" right="10">

                                                               </mx:Panel>

                                               </mx:AddChild>

                                               <mx:AddChild
relativeTo="{panel1}" position="lastChild">

 
<mx:ControlBar>

 
<mx:Button label="Button"/>

 
</mx:ControlBar>

                                               </mx:AddChild>

                               </mx:State>

                </mx:states>

                <mx:Panel layout="absolute" top="40" left="10" right="10"
bottom="10" id="panel1">

                </mx:Panel>

                <mx:Button x="29" y="10" label="Button"
click="this.currentState = currentState == 'newstate' ? '' : 'newstate'"/>

                

</mx:Application>

 

Can anyone confirm this?

 

João Fernandes

Reply via email to