Isn't a bug or something related to.

I did some wrong way or the Design mode did.

Here's a re-done code of yours, I used the Design mode too.

<?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:SetProperty target="{button1}" name="label" value="back"/>
           <mx:SetEventHandler target="{button1}" name="click"
handler="currentState=''"/>
       </mx:State>
   </mx:states>
   <mx:Panel x="201" y="63" width="250" height="200" layout="absolute">
       <mx:ControlBar>
           <mx:Button label="Next" id="button1"
click="currentState='newState'"/>
       </mx:ControlBar>
   </mx:Panel>

</mx:Application>


Regards.


On 1/8/07, João Fernandes <[EMAIL PROTECTED]> wrote:

   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




--
----------------------------
Igor Costa
www.igorcosta.org
www.igorcosta.com
skype: igorpcosta

Reply via email to