AnthonyLins / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

LoginWindow close() method #391

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
1. I created an app that needs to close the LoginWindow if the user just lets 
the LoginWindow sit there without any interaction.  Timeout, etc

I would like to recommend adding a close() method to the LoginWindow class.

In LoginWindow.as, I added:
public function closeWindow():void {
     if (html.stage.nativeWindow.closed == false) {
          html.stage.nativeWindow.close();
    }

Instead of using FacebookDesktop.login(), you would have to create a new 
instance of the LoginWindow and pass the data:

var window:LoginWindow = new LoginWindow(handleLogin);
window.open(yourAppID,params);

Then to close the window you can use:

window.close();

Original issue reported on code.google.com by lbar...@thesminc.com on 7 Dec 2011 at 3:24

GoogleCodeExporter commented 8 years ago
After using window.closeWindow() with FacebookDesktop.  It seems that you must 
use FacebookDesktop's loginWindow built-in window methods.  So just 
instantiating the window alone will not give you access to the FacebookDesktop 
class.

So I would recommend adding a closeWindow() method to the FacebookDesktop class.

FacebookDesktop.as
    public static function closeWindow():void {
     getInstance().closeWindow();
    }

    protected function closeWindow():void {

      loginWindow.closeWindow();
    }

Original comment by lbar...@thesminc.com on 7 Dec 2011 at 6:54