Detecting if Window is already open in Air

View: New views
2 Messages — Rating Filter:   Alert me  

Detecting if Window is already open in Air

by Graham Pearson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Group:

I am working on creating an update procedure for one of my Air
applications. In the application if it detects a newer version, I open
up a Window Component by the following code:

var askToUpdateApplicationWindow:AskToPerformUpdate = new
AskToPerformUpdate();
askToUpdateApplicationWindow.title = "We Are Closed Today Media
Application";
askToUpdateApplicationWindow.currentApplicationVersionNumber =
currentApplicationVersionNumber;
askToUpdateApplicationWindow.newApplicationVersionNumber =
newApplicationVersionNumber;
askToUpdateApplicationWindow.ServerName = ServerName;
askToUpdateApplicationWindow.newApplicationFileName =
newApplicationFileName;
askToUpdateApplicationWindow.open(true);


Now if the end user does not click on one of the two buttons in this
component, how can I go about checking to see if this window is
already open on the screen. Right now if the component window is open
the next time it checks to see if an update exists then I get 2
windows and I do not want that. I am wanting to bypass the update if
the window is currently open.

When I debug, askToUpdateApplicationWindow is always null from what I
can tell.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: GnuPT 2.6.2.1 by EQUIPMENTE.DE
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFJs9tr3GqPAgBSy90RAryCAJ9nUhov1GZOB3+HkQpDhdkGkwBWcgCgief7
2qsXF0JyS+F4RUFCkFmW0Ck=
=Q6Dj
-----END PGP SIGNATURE-----


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5814
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.37

RE: Detecting if Window is already open in Air

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


If you're naming the window, then you should just be able to check if that
"name" already exists. Something like:

if (!name) {
        // do something
}

-----Original Message-----
From: Graham Pearson [mailto:gpearson@...]
Sent: Sunday, March 08, 2009 9:51 AM
To: flex
Subject: Detecting if Window is already open in Air


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Group:

I am working on creating an update procedure for one of my Air applications.
In the application if it detects a newer version, I open up a Window
Component by the following code:

var askToUpdateApplicationWindow:AskToPerformUpdate = new
AskToPerformUpdate(); askToUpdateApplicationWindow.title = "We Are Closed
Today Media Application";
askToUpdateApplicationWindow.currentApplicationVersionNumber =
currentApplicationVersionNumber;
askToUpdateApplicationWindow.newApplicationVersionNumber =
newApplicationVersionNumber; askToUpdateApplicationWindow.ServerName =
ServerName; askToUpdateApplicationWindow.newApplicationFileName =
newApplicationFileName; askToUpdateApplicationWindow.open(true);


Now if the end user does not click on one of the two buttons in this
component, how can I go about checking to see if this window is already open
on the screen. Right now if the component window is open the next time it
checks to see if an update exists then I get 2 windows and I do not want
that. I am wanting to bypass the update if the window is currently open.

When I debug, askToUpdateApplicationWindow is always null from what I can
tell.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: GnuPT 2.6.2.1 by EQUIPMENTE.DE
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFJs9tr3GqPAgBSy90RAryCAJ9nUhov1GZOB3+HkQpDhdkGkwBWcgCgief7
2qsXF0JyS+F4RUFCkFmW0Ck=
=Q6Dj
-----END PGP SIGNATURE-----




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5815
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.37