show-hide on MOUSE OVER

hi guys
I have a button.when i put the mouse cursor on it , it should show the pop up , when the cursor is moved away from the button  the popup should dissapear

my code:

<mx:Button  id="teamMembersList" label="show" mouseOver="PopUp(event,projDetails.membersList);" />

private function PopUp(e:MouseEvent,list:ArrayCollection):void {                  
var popupwindow : IdWindowComponent = new IdWindowComponent();
var pt:Point = new Point(e.localX, e.localY);
pt = e.target.localToGlobal(pt);
popupwindow.x = pt.x ;
popupwindow.y = pt.y;            
popupwindow.list = list;      
popupwindow.listType = listType;
PopUpManager.addPopUp(popupwindow,this,false);            
}


Right now the mouse over works, i see the pop up when i mouse over, but the popup comes with a X to close.
I want the pop up to dissapear when the mouse cursor is moved away from the button.

any clues how i can tweak the above code?

thanks


royjaydAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dgofmanCommented:
I cannot understand why you are getting problem with this :)

import mx.managers.ToolTipManager;

private var popup:IToolTip;

private function show(event:Event, b:Boolean):void{
	var target:Button = event.target as Button;
	if(b == true){
		popup = ToolTipManager.createToolTip("Hello World", target.x + target.width, target.y, "errorTipRight");
	}else{
		ToolTipManager.destroyToolTip(popup);
	}
}

Open in new window


<mx:Button  id="teamMembersList" label="show" mouseOver="show(event, true)" mouseOut="show(event, false)"/>
royjaydAuthor Commented:
>>mouseOut
aahh.. thats the key, i dint know that.
 i am new to flex dgofman, so plz bear with me if my questions are simple (and stupid) :-)

thanks.
dgofmanCommented:
I am glad you are happy this my answers :)
Please can close this ticket from my list.
Identify and Prevent Potential Cyber-threats

Become the white hat who helps safeguard our interconnected world. Transform your career future by earning your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

royjaydAuthor Commented:
My code is slightly different, let me explain

popup:            
private function launchPopUp(e:MouseEvent,list:ArrayCollection,show:Boolean):void {      
if(show == true){
var popupwindow : IdWindowComponent = new IdWindowComponent();
var pt:Point = new Point(e.localX, e.localY);
pt = e.target.localToGlobal(pt);
popupwindow.x = pt.x ;
popupwindow.y = pt.y;                              
popupwindow.list = list; --setting list in IdWindowComponent shown below
PopUpManager.addPopUp(popupwindow,this,false);      
}
else{  //if false
PopUpManager.removePopUp(popupwindow);  //this should also work i guess?      
}
                              
                         
                         
}





<mx:Button  label="show" mouseOver="launchPopUp(event,projDetails.teamMembersList,true);"
mouseOut="launchPopUp(event,projDetails.teamMembersList,false);" />


and this is my IdWindowComponent

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" width="186" height="262" horizontalAlign="center"            
verticalAlign="top"
barColor="#000066"                               
borderColor="#000066">
      
      
<mx:Script>
<![CDATA[
public var list:ArrayCollection;      
]]>
</mx:Script>      
<mx:DataGrid id="dataGrid" dataProvider="{list}" width="146" height="201">
<mx:columns>
<mx:DataGridColumn dataField="id"/>      --display list in a grid                  
</mx:columns>
</mx:DataGrid>
      
</mx:TitleWindow>

the Mouseover and mouseout dont seem to work in this scenario, any idea where i am going wrong?

thanks.
dgofmanCommented:
Are you using SDK 3 in your Eclipse (only), because you code for halo theme.
dgofmanCommented:
Are you sure you looked my example.

Where am I declared popup instance variable???

Why you declared inside your function???

How Flex will close your window if you declared localy and by calling on mouseOut is NULL???

Check this

private var popupwindow : IdWindowComponent;

private function launchPopUp(e:MouseEvent,list:ArrayCollection,show:Boolean):void {      
     if(show == true){
             popupwindow = new IdWindowComponent(); 

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
royjaydAuthor Commented:
thanks v much.

any help with my next question is greatly appreciated.

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_26921802.html

thx.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.