Change TitleWindow position and size in state : TitleWindow « Container « Flex






Change TitleWindow position and size in state

Change TitleWindow position and size in state
     

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:states>
        <mx:State name="A">
            <mx:SetProperty target="{windowA}" name="width" value="500"/>
            <mx:SetProperty target="{windowA}" name="height" value="300"/>
            <mx:SetProperty target="{windowC}" name="width" value="150"/>
            <mx:SetProperty target="{windowC}" name="height" value="150"/>
            <mx:SetProperty target="{windowC}" name="y" value="333"/>
            <mx:SetProperty target="{windowD}" name="x" value="373"/>
            <mx:SetProperty target="{windowD}" name="width" value="150"/>
            <mx:SetProperty target="{windowD}" name="height" value="150"/>
            <mx:SetProperty target="{windowD}" name="y" value="333"/>
            <mx:SetProperty target="{windowB}" name="x" value="23"/>
            <mx:SetProperty target="{windowB}" name="y" value="333"/>
            <mx:SetProperty target="{windowB}" name="width" value="150"/>
            <mx:SetProperty target="{windowB}" name="height" value="150"/>
            <mx:SetProperty target="{windowC}" name="x" value="200"/>
        </mx:State>
    </mx:states>

    <mx:transitions>
        <mx:Transition fromState="*" toState="*">
            <mx:Parallel targets="{[windowA, windowB, windowC, windowD]}">
                <mx:Move />
                <mx:Resize />
            </mx:Parallel>
        </mx:Transition>
    </mx:transitions>

    <mx:TitleWindow x="23" y="19" width="250" height="200" layout="absolute" title="A" id="windowA" click="currentState='A'" />
    <mx:TitleWindow x="309" y="19" width="250" height="200" layout="absolute" title="B" id="windowB" click="currentState=''" />
    <mx:TitleWindow x="23" y="260" width="250" height="200" layout="absolute" title="C" id="windowC" click="currentState='A'" />
    <mx:TitleWindow x="309" y="260" width="250" height="200" layout="absolute" title="D" id="windowD" click="currentState=''" />

</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Add close event listener for TitleWindowAdd close event listener for TitleWindow
2.Add Mouse Down listener to TitleWindowAdd Mouse Down listener to TitleWindow
3.Adding mouse event to Panel and TitleWindowAdding mouse event to Panel and TitleWindow
4.Creates a TitleWindow container inside a Panel container.Creates a TitleWindow container inside a Panel container.
5.Resize TitleWindow with TransitionResize TitleWindow with Transition
6.Add control to TitleWindowAdd control to TitleWindow
7.Make TitleWindow to show Close buttonMake TitleWindow to show Close button
8.Add close handler to TitleWindowAdd close handler to TitleWindow
9.Top level TitleWindow tag
10.TitleWindow Title, close button, position, border color and border alphaTitleWindow Title, close button, position, border color and border alpha
11.Add button to window through ActionScriptAdd button to window through ActionScript