I have tried using that, and it gives me a big goose
egg.
This is the updated code.
public function createWindow(wTitle:String, wX:Number, wY:Number,
wWidth:Number, wHeight:Number):void {
title = new TitleWindow();
title.name = wTitle;
title.id = wTitle;
title.title = wTitle;
title.x = wX;
title.y = wY;
title.visible = true;
title.showCloseButton = true;
title.addEventListener(CloseEvent.CLOSE, removeMe);
windowArray.push(title);
PopUpManager.addPopUp(title, mainCanvas);
addStates(wX, wY, wWidth, wHeight);
}
public function removeMe(event:CloseEvent){
PopUpManager.removePopUp(this)
}
--- In [EMAIL PROTECTED]ups.com,
"Dustin Mercer" <dustin.mercer@...>
wrote:
>
> Have you tried:
>
> title.addEventListener( CloseEvent.CLOSE, setState );
>
> instead of:
>
> title.addEventListener( MouseEvent.CLICK, setState );
>
>
>
> That should take care of it...
>
>
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
On
> Behalf Of Jeremy Rottman
> Sent: Thursday, October 19, 2006 1:55 PM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Creating JarJam button Effect.
>
>
>
> I am taking an idea from the JarJam demo that adobe has posted on
adobe
> labs and recreating it to suit our needs. I almost have it complete
and
> working, but I have run into two little snags.
>
> When I create the titlewindow with actionscript, I am unable to get
the
> close button at the top of the titlewindow to work. I have looked at
> every example I could find and not a single one works. With the code I
> have provided does anyone see why this wont work?
>
> Any help with this is greatly appreciated.
>
> Here is a link to my test application, and source.
> http://beta.homesmartagent.com/transitions/JamJarEffect.html
> <http://beta.homesmartagent.com/transitions/JamJarEffect.html>
> http://beta.homesmartagent.com/transitions/srcview/
> <http://beta.homesmartagent.com/transitions/srcview/>
>