Hi Madan,

I have tried the same thing using states. Check out the following
code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" height="100%" width="100%"
verticalScrollPolicy="off" horizontalScrollPolicy="off">
        <mx:states>
                <mx:State name="toAddState">
                    <mx:SetStyle name="bottom" value="10" 
target="{notificationBox}"/
>

                </mx:State>
        </mx:states>
        <mx:transitions>
                <mx:Transition fromState="*" toState="toAddState">
            <mx:Parallel id="t1" target="{notificationBox}">
                <mx:Move duration="400"/>
            </mx:Parallel>
        </mx:Transition>
        <mx:Transition fromState="toAddState" toState="*">
            <mx:Parallel id="t2" target="{notificationBox}">
                <mx:Move duration="400"/>
            </mx:Parallel>
        </mx:Transition>
    </mx:transitions>
        <mx:Button click="currentState='toAddState'" right="80" label="Show"/
>
        <mx:Button click="currentState=''" right="5" label="Hide"/>

        <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml";
  styleName="popupWindowStyle"
  showEffect="myMove"
  hideEffect="myMove"
  visible="true"
  includeInLayout="true"
  right="5"
  bottom="-100"
  width="240"
  height="90"
  showCloseButton="true"
  title="Notifications"
  id="notificationBox"
  >
 </mx:TitleWindow>
</mx:Application>

HTH,

-Ravi


On Mar 13, 12:58 am, Madan Narra <[email protected]> wrote:
> Hi All,
>
> I want to display a notification box that be displayed at Bottom X and Y
> coordinates. Same as the yahoo messenger notifies when there are any
> contacts sign-in or sign-out.
>
> I have written the code. This is working as expected, but causing some issue
> which i was not able to predict.
>
> Can anyone please analyze and let me know where i went wrong.
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
> creationComplete="init()">
>  <mx:Script>
>   <![CDATA[
>    import mx.effects.easing.Linear;
>
>    [Bindable] var xx:int;
>    [Bindable] var yy:int;
>
>    private function init():void {
>     xx = topBox.screen.bottomRight.x;
>     yy = topBox.screen.bottomRight.y;
>
>     message.text = "ACTUAL :: x :: "+xx+"  yy :: "+yy;
>    }
>
>    private function showNotification():void {
>     notificationBox.visible = true;
>     notificationBox.includeInLayout = true;
>
>     notificationBox.width=240;
>     notificationBox.height=90;
>
>     //myMove.xFrom = xx;
>     //myMove.xTo = xx - 250;
>
>     newMessage.text = "from yy "+yy+"   to yy "+(yy - 100);
>
>     myMove.play();
>    }
>
>    private function hideNotification():void {
>     //myMove.xFrom = xx - 250;
>     //myMove.xTo = xx;
>
>     myMove.yFrom = yy - 100;
>     myMove.yTo = yy;
>
>     newMessage.text = "from yy "+(yy - 100)+"   to yy "+yy;
>
>     notificationBox.visible = false;
>     notificationBox.includeInLayout = false;
>
>     myMove.play();
>    }
>
>   ]]>
>  </mx:Script>
>
>  <mx:Move target="{notificationBox}" id="myMove"
> easingFunction="Linear.easeIn"/>
>
>  <mx:Style>
>   .popupWindowStyle {
>      background-color: #FFFFFF;
>      padding-top: 0;
>      padding-left: 0;
>      padding-right: 0;
>      padding-bottom: 0;
>      header-height: 20;
>      border-thickness-bottom: 5;
>      border-thickness-top: 5;
>      border-thickness-left: 5;
>      border-thickness-right: 5;
>      border-color:#C0C0C0;
>      header-colors: #FFFFFF, #BCC2CD;
>      borderColor: #C0C0C0;
>      borderStyle: solid;
>   }
>  </mx:Style>
>
>  <mx:VBox width="100%" height="100%" id="topBox">
>
>   <mx:Box width="100%" height="20%" backgroundColor="green">
>
>   </mx:Box>
>
>   <mx:HBox width="100%" height="100%">
>    <mx:VBox width="30%" height="100%" backgroundColor="red">
>
>    </mx:VBox>
>    <mx:VBox width="100%" height="100%" backgroundColor="yellow"
> verticalAlign="middle">
>     <mx:Label id="message"/>
>
>     <mx:Spacer height="20"/>
>
>     <mx:Label id="newMessage"/>
>
>     <mx:Spacer height="20"/>
>
>     <mx:Button label="Show Notification" click="showNotification()"/>
>     <mx:Button label="Hide Notification" click="hideNotification()"/>
>    </mx:VBox>
>   </mx:HBox>
>
>   <mx:Box width="100%" height="10%" backgroundColor="green">
>
>   </mx:Box>
>
>  </mx:VBox>
>
>  <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml";
>   styleName="popupWindowStyle"
>   showEffect="myMove"
>   hideEffect="myMove"
>   visible="false"
>   includeInLayout="false"
>   x ="{xx - 250}"
>   y="{yy - 100}"
>   width="240"
>   height="90"
>   showCloseButton="true"
>   label="Notifications"
>   id="notificationBox"
>   >
>  </mx:TitleWindow>
> </mx:Application>
>
> --
> Thanks,
> Madan N
--~--~---------~--~----~------------~-------~--~----~
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