Firefox won't let you close a window... if that's a requirement.  It "can" if the user has his setting set to allow closing the browser window but that's not the default.

On 8/29/05, Tracy Spratt <[EMAIL PROTECTED]> wrote:
Sometimes this works to avoid the browser prompt:
getURL("_javascript_:window.opener=self; window.close ();");
Tested on IE only.
Tracy

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com ] On Behalf Of Abdul Qabiz
Sent: Monday, August 29, 2005 3:18 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Closing Browser

You can call _javascript_ function from ActionScript using getURL(..)

I think following should work.

getURL("_javascript_:window.close()");


-abdul


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Prasad Dhananjaya
Sent: Monday, August 29, 2005 7:22 AM
To: FlexML
Subject: [flexcoders] Closing Browser

Hi,

Can someone plese tell me how close browser.
I want to do this when I select "Close" in my menubar.


Thanks
Prasad


-----------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

   <mx:Script>
       function menuHandler(event) {
                       if (event.menuItem.attributes.label=="Close"){
                               alert("Do you want to close this window?","Close Window");
★                               event.close();
               }
               }
   </mx:Script>

<mx:Canvas width="98%" height="100%">
<mx:Panel x="4" y="37" width="853" height="497" barColor="#FFFFFF" title="Panal1" textAlign="left" fontSize="12" fontStyle="normal" fontWeight="normal" focusOutEffect="Dissolve" >
<mx:MenuBar id="myMenuBar" width="779" change="menuHandler(event)" height="29" fontFamily="Times" backgroundDisabledColor="#FFFFFF">
<mx:dataProvider>
<mx:XML>
<menuitem label="File" >
       <menuitem label="Save" />
       <menuitem type="separator" />
       <menuitem label="Close"  />
</menuitem>
</mx:XML>
</mx:dataProvider>
</mx:MenuBar>
</mx:Panel>
</mx:Canvas>
</mx:Application>




--
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









--
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










------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->

--
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

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
   [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/






--
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




Reply via email to