--- In [email protected], "j_lentzz" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I have a screen that has 2 states that I move between.  Neither one is
> the baseState.  I have a checkbox that pops up an Alert box for
> confirmation.  When the Alert pops up, the screen goes to a third
> state (maybe the baseState), instead of staying on the currentState. 
> Has anyone else seen this and know how to prevent the changing state?
> 
> Thank you,
> 
> John
>
FWIW, I tried changing the code to have a baseState and a 2nd state. 
The second state does the following:
<mx:State name="dateModeState">
        <mx:RemoveChild target="{startDateLabel}"/>
        <mx:RemoveChild target="{startDate}"/>
        <mx:RemoveChild target="{spacer1}"/>
        <mx:RemoveChild target="{numDaysLabel}"/>
        <mx:RemoveChild target="{numDays}"/>
        <mx:RemoveChild target="{spacer2}"/>
        <mx:RemoveChild target="{endDateLabel}"/>
        <mx:RemoveChild target="{endDate}"/>
        <mx:RemoveChild target="{nonDmSpacer}"/>
                
        <mx:AddChild position="firstChild" relativeTo="{dateHBox}">
               <mx:Label text="Date:" id="dateModeDateLabel"
fontWeight="bold" visible="{dateMode.selected}"
width="{setDateModeWidth(dateMode.selected, 'dateModeDateLabel')}"/>
        </mx:AddChild>
            <mx:AddChild position="after" relativeTo="{dateModeDateLabel}">
                 <mx:DateField id="dateModeDate" editable="true"
focusOut="dateLosingFocusHandler(event)"
keyDown="dateCheckForEnter(event)" 
                                close="dateCloseHandler(event)"
visible="{dateMode.selected}"
width="{setDateModeWidth(dateMode.selected, 'dateModeDate')}"
                                selectableRange="{{rangeEnd: new Date()}}"/>
        </mx:AddChild>
        <mx:AddChild position="after" relativeTo="{dateModeDate}">
                <mx:Spacer id="dmSpacer" width="418" height="10"/>
        </mx:AddChild>
</mx:State>


What it looks like is happening is that when the Alert box appears,
the RemoveChild statements are executed, but not the AddChild.  As a
result, the screen visually changes when the Alert box appears.

John

Reply via email to