I'm trying to make a growl type notification bar on the bottom of my
app.  I can get the transparent bar to show up but I can't get a label
to show up in it.  In the code below i have described one in MXML and
added one dynamically.

I think it has to do with my resize function.  I am going from 0 to a
height of -120.  If I can't use a negative height, how can I achieve
the same effect?

-Nate


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <mx:Script>
                <![CDATA[
                //Code for popup comment window
                import mx.controls.Label;
                import mx.containers.Box;
                
                private function menuMovedOn():void{
                        addCommentText();
                        if (myTimer.running){
                                myTimer.stop();
                        }
                        if (!openPlay){
                                timerStart()
                        }       
                }
                private var openPlay:Boolean = false;
                private var myTimer:Timer = new Timer(2000, 1)
                private function timerStart():void{     
                        
                        if (!myTimer.hasEventListener("timer")){
                                myTimer.addEventListener("timer", timerHandler);
                        }
                        myTimer.start();
                }
                //This isn't showing up!  Perhaps it's because Im making it 
have a
-height?
                private function addCommentText():void{
                        var myLabel:Label = new Label();
                        myLabel.text = "Hello World!";
                        myLabel.height = 30;
                        myLabel.width = 200;
                        myLabel.setStyle("color", uint(0xffffff));
                        commentWindow.addChild(myLabel);
                }
                private function timerHandler(event:TimerEvent):void{
                        closeCommentWindow();
                }
                private function closeCommentWindow():void{
                        menuMoveOff.play()
                }
                private function menuMouseOver(event:MouseEvent):void{
                        myTimer.stop();
                        if(menuMoveOff.isPlaying){
                                menuMoveOff.reverse()
                        }
                        if (menuMoveOn.isPlaying){
                                openPlay = true;
                        }
                }
                private function menuMouseOut(event:MouseEvent):void{
                        closeCommentWindow();
                }
        ]]>
        </mx:Script>
        
        <mx:Parallel id="menuMoveOn" target="{commentWindow}"
effectEnd="menuMovedOn()">
        <mx:Resize heightFrom="0" heightTo="-120" duration="800"/>
        </mx:Parallel>
        
        <mx:Parallel id="menuMoveOff" target="{commentWindow}">
        <mx:Resize heightFrom="-120" heightTo="0" duration="800"/>
        </mx:Parallel>
        <mx:Button label="myButton" click="menuMoveOn.play()"/>
        <mx:VBox id="commentWindow" backgroundAlpha=".8"
backgroundColor="0x000000" y="{application.height}" x="0" width="100%"
mouseOut="menuMouseOut(event)" mouseOver="menuMouseOver(event)">
                <mx:Label text="Hi Hi Hi" color="0xffffff"/>
        </mx:VBox>
        
</mx:Application>


Reply via email to