|
Matt & Clint, I tried the below code, and I can’t
get it to work for me in Mozilla or IE. Am I missing something? Thanks for your help! Allen Manning ------------ <?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"
keyUp="this_keyUp()"> <mx:Script> <![CDATA[ //here's the code 4 the func private function this_keyUp() { if (Key.getCode() ==
Key.ESCAPE) this.deletePopUp(); } ]]> </mx:Script> <mx:Label text="Hit the
[ESCAPE] button to close."/> </mx:TitleWindow> 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
-- -- -- |

