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 =;
popupwindow.x = pt.x ;
popupwindow.y = pt.y;            
popupwindow.list = list;      
popupwindow.listType = listType;

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?


Who is Participating?

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

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.

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 = as Button;
	if(b == true){
		popup = ToolTipManager.createToolTip("Hello World", target.x + target.width, target.y, "errorTipRight");

Open in new window

<mx:Button  id="teamMembersList" label="show" mouseOver="show(event, true)" mouseOut="show(event, false)"/>
royjaydAuthor Commented:
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) :-)

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

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 =;
popupwindow.x = pt.x ;
popupwindow.y = pt.y;                              
popupwindow.list = list; --setting list in IdWindowComponent shown below
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=""
layout="vertical" width="186" height="262" horizontalAlign="center"            
public var list:ArrayCollection;      
<mx:DataGrid id="dataGrid" dataProvider="{list}" width="146" height="201">
<mx:DataGridColumn dataField="id"/>      --display list in a grid                  

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

Are you using SDK 3 in your Eclipse (only), because you code for halo theme.
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.

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.