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: [email protected] [mailto:[email protected]] On Behalf Of Clint Modien
Sent: Thursday, July 21, 2005 5:53 AM
To: [email protected]
Subject: Re: [flexcoders] Closing Title Popup with [Escape], works in Mozilla but not IE??

 

works on my IE... and i don't seem to be doing anything fancy...

here's the code i run...

on the TitleWindow i set the keyUp to the func

<mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml"  keyUp="this_keyUp()">

//here's the code 4 the func
private function this_keyUp()
    {
        if (Key.getCode() == Key.ESCAPE) this.deletePopUp();
    }



Disclaimer:
Matt Chotin has helped me with almost every problem I've posted here.  *Thanks for that Matt*


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
Sent: Wednesday, July 20, 2005 9:45 AM
To: [email protected]
Subject: [flexcoders] Closing Title Popup with [Escape], works in Mozilla but not IE??

 

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

http://www.prismix.com/




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



YAHOO! GROUPS LINKS

 

 


 

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.269 / Virus Database: 267.9.2 - Release Date: 19/07/2005





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to