You can call javascript function from ActionScript using getURL(..)
I think following should work.
getURL("javascript:window.close()");
-abdul
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 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
------------------------ 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/