You can also do a trick where you do a getURL() to a small "special"
html file which simply has this in it:

<BODY ONLOAD="top.close()">

Should be pretty transparent to the user.  So essentially, the HTML file
does the Javascript, not Flash.  However, if the original Flash file is
not spawned from Javascript, doing this still works, but you get a
prompt first.  This is how we get around Javascript security issues when
the Flash 8/9 player is running inside the iceplayer.

Jason Merrill
Bank of America 
Learning & Organizational Effectiveness
 
 
 
 
 

>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Geoff Stearns
>>Sent: Wednesday, November 08, 2006 10:49 AM
>>To: Flashcoders mailing list
>>Subject: Re: [Flashcoders] Closing Browser Through Flash/Javascript
>>
>>you need to add allowscriptaccess=always to your embed code.
>>
>>BUT, even with that, you might not be able to close it.. usually when
>>you try to close a window you didn't open yourself, you get prompted
>>by the browser... nothing you can do about that.
>>
>>if you really want it to behave like an app, you should look into
>>using one of the swf wrapper programs.
>>
>>
>>On Nov 8, 2006, at 8:09 AM, Holth, Daniel C. wrote:
>>
>>>
>>> Hello,
>>>
>>> We are building Flash application that will be run off a CD and
>>> would like to have a button that closes the browser the Flash
>>> application is running in.  We keep getting security errors that
>>> 'main.swf' is trying to communicate with 'index.html'.  I know that
>>> I can personally set these to 'always allow' but we do not want our
>>> clients to get any security messages.
>>>
>>> The java script code in the html page is:
>>>
>>> <script type="text/javascript" language="JavaScript" name="cmifrag">
>>>     function index_f_DoFSCommand(command, args){
>>>             if(command == "close"){
>>>                     self.opener=null;
>>>                     self.close();
>>>             }
>>>     }
>>> </script>
>>>
>>> and the actionscript called by the button is:
>>>
>>> function exit(){
>>>     fscommand("close");
>>> }
>>>
>>>
>>> Any help is greatly appreciated. Thanks!
>>> -Dan
>>>
>>> This e-mail and its attachments are intended only for the use of
>>> the addressee(s) and may contain privileged, confidential or
>>> proprietary information. If you are not the intended recipient, or
>>> the employee or agent responsible for delivering the message to the
>>> intended recipient, you are hereby notified that any dissemination,
>>> distribution, displaying, copying, or use of this information is
>>> strictly prohibited. If you have received this communication in
>>> error, please inform the sender immediately and delete and destroy
>>> any record of this message. Thank you.
>>> _______________________________________________
>>> [email protected]
>>> To change your subscription options or search the archive:
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>> Brought to you by Fig Leaf Software
>>> Premier Authorized Adobe Consulting and Training
>>> http://www.figleaf.com
>>> http://training.figleaf.com
>>
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to