Hi Pradeep,

Please refer the code below, In this code there are 2 Hbox which are
in ViewStack. And clicking on buttons i am showing one Hbox and hiding
another hbox with effects.

<mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml";
        layout="absolute"
        width="100%"
        height="100%"
        creationComplete="initMe()">
        <mx:Script>
                <![CDATA[
                        import mx.controls.Alert;
                        private function initMe():void
                        {
                                myViewStack.selectedIndex = 0;
                        }
                        private function changeViewStack(indexVal:int):void
                        {
                                myViewStack.selectedIndex = indexVal;
                        }
                ]]>
        </mx:Script>
        <mx:WipeUp duration="400" id="wipeLeft"/>
        <mx:WipeDown duration="400" id="wipeRight"/>

        <mx:VBox width="100%" height="100%">
                <mx:HBox width="100%">
                        <mx:Button id="butRed" label="Red" 
click="changeViewStack(0)"/>
                        <mx:Button id="butYellw" label="Yellow" 
click="changeViewStack(1)"/
>
                </mx:HBox>
                <mx:Panel title="Red BackGround" width="100%" height="100%">
                        <mx:ViewStack id="myViewStack" width="100%" 
height="100%"
selectedIndex="0">
                                        <mx:HBox width="100%" height="100%" 
backgroundColor="Red"
showEffect="{wipeRight}" hideEffect="{wipeLeft}"/>
                                        <mx:HBox width="100%" height="100%" 
backgroundColor="Yellow"
showEffect="{wipeRight}" hideEffect="{wipeLeft}"/>
                        </mx:ViewStack>
                </mx:Panel>
        </mx:VBox>
</mx:Application>


Please let me know if any issues.

Regards,
Pradip Jadhav

On Aug 26, 6:05 pm, pradeepflex <[email protected]> wrote:
> Hi,
>
> This is the sample code of what we are using in my project
> The way which we are using to apply effect when using
> removeAllchildren from viewstack
>
> Requirement is when i click on second button the canvas which i was
> created dynamically has to remove with wipe up effect
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> initialize="initApp(event)">
> <mx:Script>
>         <![CDATA[
>                 import mx.messaging.AbstractConsumer;
>                 import mx.controls.Alert;
>                 import mx.controls.Label;
>                 import mx.containers.Canvas;
>                 public function initApp(event:Event):void{
>
>                         var canvas:Canvas = new Canvas();
>                         canvas.setStyle("addedEffect",moveIn);
>                         canvas.setStyle("removedEffect",moveOut);
>                         var label:Label = new Label();
>                         label.text =event.currentTarget.id.toString();
>                         canvas.addChild(label);
>                         //myViewStack.removeAllChildren();
>                         myViewStack.addChild(canvas);
>
>                 }
>         ]]>
> </mx:Script>
>         <mx:Move id="moveIn" duration="2000" xFrom="{-width}" xTo="0"/>
>         <mx:Move id="moveOut" xFrom="0" xTo="{width}"/>
>      <mx:Panel title="ViewStack Container Example" height="95%"
> width="95%"
>          paddingTop="10" paddingLeft="10" paddingRight="10"
> paddingBottom="10">
>
>         <mx:Text width="100%" color="blue"
>             text="Use the Button controls to change panels of the
> ViewStack container."/>
>
>         <mx:HBox borderStyle="solid" width="100%"
>             paddingTop="5" paddingLeft="5" paddingRight="5"
> paddingBottom="5">
>
>             <mx:Button id="searchButton" label="Search Panel"
>                 click="initApp(event)"/>
>             <mx:Button id="cInfoButton" label="Customer Info Panel"
>                 click="initApp(event)"/>
>             <mx:Button id="aInfoButton" label="Account Panel"
>                 click="initApp(event)"/>
>         </mx:HBox>
>
>         <!-- Define the ViewStack and the three child containers and
> have it
>         resize up to the size of the container for the buttons. -->
>         <mx:ViewStack id="myViewStack" borderStyle="solid"
> width="100%" height="80%">
>
>         </mx:ViewStack>
>
>     </mx:Panel>
> </mx:Application>
>
> Guys,please let me know how can i put effect with using
> removeAllChildren method
>
> Thanks for any advanced help
>
> Regards,
> Pradeep

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to