|
Excellent, hope this works! I help now so you guys can help each other
in the future, a cheesy pay it forward kind of thing J From: works on my IE... and i
don't seem to be doing anything fancy... On 7/21/05, Matt
Chotin <[EMAIL PROTECTED]>
wrote: I'm not sure I've ever gotten IE to pass the escape key
through to the Player unfortunately. Matt From: [email protected]
[mailto:[email protected]]
On Behalf Of Allen Manning Hello Flexcoders, I can close the pop-up with the Escape key in Mozilla but not IE.
Any ideas? Index.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> private function
openPopup():Void {
/*
createPopUp(parent:MovieClip, class:Object [,
modal:Boolean, initobj:Object,outsideEvents:Boolean]) : MovieClip
*/
var model:Boolean = true;
var myWin_mc = mx.managers.PopUpManager.createPopUp(this,TitleWindow,model);
//center of this mc
myWin_mc.centerPopUp();
//Create the event handler to delete the pop up when closed
var eventHandlerObj = new Object();
eventHandlerObj.click = function(event)
{
event.target.deletePopUp();
}
//Register the event handler with the TitleWindow container.
myWin_mc.addEventListener("click",eventHandlerObj); } </mx:Script> <mx:HBox> <mx:Button
click="openPopup()" label="Open"/> </mx:HBox> </mx:Application> TitleWindow.mxml <?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml"
title="Popup" width="300" height="300" closeButton="true"
initialize="initKeyDown();"> <mx:Script> private function
initKeyDown():Void { var
myListener:Object = new Object(); myListener. handleKeyDown);
Key.addListener(myListener); } private function
handleKeyDown (event) : Void { if
(Key.isDown(Key.ESCAPE)) {
this.deletePopUp();
Key.removeListener(handleKeyDown);
}
} </mx:Script> <mx:Label text="Hit the [ESCAPE] button to
close."/> </mx:TitleWindow> Thanks, Allen
YAHOO!
GROUPS LINKS
--
|
- RE: [flexcoders] Closing Title Popup with [Escape], works in... Matt Chotin

