You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mo...@comcast.net on 2014/04/07 03:53:59 UTC

can Flex place focus on browser window already opened with navigateToURL()?

The first time navitageToURL() is executed, a browser window opens and obtains focus. 

The user views the help file, then goes back to the web app. 

Later, the user clicks to a link that points to a different named destination in the same PDF file. Nothing happens (actually, the PDF file moved to the correct named destination location, but the focus remains in the web app and there nothing noticeable happens). The user has to "know" that he/she must click the browser tab that opened the first time. 

Is there a way that Flex can set focus to the HELP browser window opened with navigateToURL(...,"HELP")? Or how do people address this? Should a popup appear in the web app instructing the user to click on the browser window? etc. 

Re: can Flex place focus on browser window already opened with navigateToURL()?

Posted by Alex Harui <ah...@adobe.com>.
If you can find a way to do it from JavaScript you can call it from
ExternalInterface

On 4/6/14 6:53 PM, "modjklist@comcast.net" <mo...@comcast.net> wrote:

>The first time navitageToURL() is executed, a browser window opens and
>obtains focus. 
>
>The user views the help file, then goes back to the web app.
>
>Later, the user clicks to a link that points to a different named
>destination in the same PDF file. Nothing happens (actually, the PDF file
>moved to the correct named destination location, but the focus remains in
>the web app and there nothing noticeable happens). The user has to "know"
>that he/she must click the browser tab that opened the first time.
>
>Is there a way that Flex can set focus to the HELP browser window opened
>with navigateToURL(...,"HELP")? Or how do people address this? Should a
>popup appear in the web app instructing the user to click on the browser
>window? etc. 


RE: can Flex place focus on browser window already opened with navigateToURL()?

Posted by ma...@usmc.mil.
Well maybe you could create javascript function inside your main window running your flex app/wrapper and use an ExternalInterface to call that instead.  I would start by having the function use an Alert to show it's being called properly.  Then work up to show it's got the window handle.

-Mark

-----Original Message-----
From: modjklist@comcast.net [mailto:modjklist@comcast.net]
Sent: Monday, April 07, 2014 2:51 PM
To: users@flex.apache.org
Subject: Re: can Flex place focus on browser window already opened with navigateToURL()?

Anyone know the secret combination to place focus on a specific (e.g. 'pdfWindow') browser window using ExternalInterace.call(...)?

I've tried experimenting with javascript and ExternalInterface, based on Mark and Alex's previous comments, using combinations of

var callString:String="window.open(null,'pdfWindow').focus()";
//var callString:String="window.location(null,'pdfWindow').focus()";


and

ExternalInterface.call(callString);
//ExternalInterface.call("eval(" + callString + ")");
and so far haven't had any success placing focus on the already opened browser window.

Re: can Flex place focus on browser window already opened with navigateToURL()?

Posted by mo...@comcast.net.
Anyone know the secret combination to place focus on a specific (e.g. 'pdfWindow') browser window using ExternalInterace.call(...)? 

I've tried experimenting with javascript and ExternalInterface, based on Mark and Alex's previous comments, using combinations of 

var callString:String="window.open(null,'pdfWindow').focus()"; 
//var callString:String="window.location(null,'pdfWindow').focus()"; 


and 

ExternalInterface.call(callString); 
//ExternalInterface.call("eval(" + callString + ")"); 
and so far haven't had any success placing focus on the already opened browser window. 

----- Original Message -----

From: "mark kessler ctr" <ma...@usmc.mil> 
To: users@flex.apache.org 
Sent: Monday, April 7, 2014 9:44:31 AM 
Subject: RE: can Flex place focus on browser window already opened with navigateToURL()? 

I believe the javascript might be something like [1] to get the window handle and to set its focus. I think you can run single like javascript out of the navigateToURL() as well... such as [2]. But I haven't tested these atm. 


[1] window.open(null,"windowname").focus(); 
[2] javascript:window.open(null,"windowname").focus() 


-Mark 

-----Original Message----- 
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Monday, April 07, 2014 11:29 AM 
To: users@flex.apache.org 
Subject: Re: can Flex place focus on browser window already opened with navigateToURL()? 

Thanks Mark, that's what I'm doing. The issue is... 

// The first time file is downloaded... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 1"), "mywindowname"); // window opens and focus automatically goes to "mywindowname" window 
... 
// then sometime in the future... 
... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 2"), "mywindowname"); // When user clicks this, PDF advances to Chapter 2, but focus stays in web app (with no indication given to user that anything happened). User must understand he/she needs to look back at the "mywindowname" window. 

How to programmatically give focus to "mywindowname" window here? 

----- Original Message ----- 

From: "mark kessler ctr" <ma...@usmc.mil> 
To: users@flex.apache.org 
Sent: Monday, April 7, 2014 4:25:09 AM 
Subject: RE: can Flex place focus on browser window already opened with navigateToURL()? 

Yes if you open a new window/tab and pass it a name instead of say "_blank", you can call that window again by its name. I use that technique for changing the navigation(deep-linking) in other web applications that are open. [1], Also I believe if you have a PDF exposed to the web browser you can use hash (#) type navigation to change it to bookmarks or pages in the PDF. 

navigateToURL(new URLRequest("http://www.google.com", "mywindowname"); 


-Mark 

[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL() 


-----Original Message----- 
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Sunday, April 06, 2014 9:54 PM 
To: apache flex users 
Subject: can Flex place focus on browser window already opened with navigateToURL()? 

The first time navitageToURL() is executed, a browser window opens and obtains focus. 

The user views the help file, then goes back to the web app. 

Later, the user clicks to a link that points to a different named destination in the same PDF file. Nothing happens (actually, the PDF file moved to the correct named destination location, but the focus remains in the web app and there nothing noticeable happens). The user has to "know" that he/she must click the browser tab that opened the first time. 

Is there a way that Flex can set focus to the HELP browser window opened with navigateToURL(...,"HELP")? Or how do people address this? Should a popup appear in the web app instructing the user to click on the browser window? etc. 



RE: can Flex place focus on browser window already opened with navigateToURL()?

Posted by ma...@usmc.mil.
I believe the javascript might be something like [1] to get the window handle and to set its focus.  I think you can run single like javascript out of the navigateToURL() as well... such as [2].  But I haven't tested these atm.


[1] window.open(null,"windowname").focus();
[2] javascript:window.open(null,"windowname").focus()


-Mark

-----Original Message-----
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Monday, April 07, 2014 11:29 AM
To: users@flex.apache.org
Subject: Re: can Flex place focus on browser window already opened with navigateToURL()?

Thanks Mark, that's what I'm doing. The issue is... 

// The first time file is downloaded... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 1"), "mywindowname"); // window opens and focus automatically goes to "mywindowname" window 
... 
// then sometime in the future... 
... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 2"), "mywindowname"); // When user clicks this, PDF advances to Chapter 2, but focus stays in web app (with no indication given to user that anything happened). User must understand he/she needs to look back at the "mywindowname" window. 

How to programmatically give focus to "mywindowname" window here? 

----- Original Message -----

From: "mark kessler ctr" <ma...@usmc.mil> 
To: users@flex.apache.org 
Sent: Monday, April 7, 2014 4:25:09 AM 
Subject: RE: can Flex place focus on browser window already opened with navigateToURL()? 

Yes if you open a new window/tab and pass it a name instead of say "_blank", you can call that window again by its name. I use that technique for changing the navigation(deep-linking) in other web applications that are open. [1], Also I believe if you have a PDF exposed to the web browser you can use hash (#) type navigation to change it to bookmarks or pages in the PDF. 

navigateToURL(new URLRequest("http://www.google.com", "mywindowname"); 


-Mark 

[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL() 


-----Original Message----- 
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Sunday, April 06, 2014 9:54 PM 
To: apache flex users 
Subject: can Flex place focus on browser window already opened with navigateToURL()? 

The first time navitageToURL() is executed, a browser window opens and obtains focus. 

The user views the help file, then goes back to the web app. 

Later, the user clicks to a link that points to a different named destination in the same PDF file. Nothing happens (actually, the PDF file moved to the correct named destination location, but the focus remains in the web app and there nothing noticeable happens). The user has to "know" that he/she must click the browser tab that opened the first time. 

Is there a way that Flex can set focus to the HELP browser window opened with navigateToURL(...,"HELP")? Or how do people address this? Should a popup appear in the web app instructing the user to click on the browser window? etc. 


Re: can Flex place focus on browser window already opened with navigateToURL()?

Posted by mo...@comcast.net.
Thanks Mark, that's what I'm doing. The issue is... 

// The first time file is downloaded... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 1"), "mywindowname"); // window opens and focus automatically goes to "mywindowname" window 
... 
// then sometime in the future... 
... 
navigateToURL(new URLRequest("http://www.google.com/myPDFFile.pdf#nameddest=Chapter 2"), "mywindowname"); // When user clicks this, PDF advances to Chapter 2, but focus stays in web app (with no indication given to user that anything happened). User must understand he/she needs to look back at the "mywindowname" window. 

How to programmatically give focus to "mywindowname" window here? 

----- Original Message -----

From: "mark kessler ctr" <ma...@usmc.mil> 
To: users@flex.apache.org 
Sent: Monday, April 7, 2014 4:25:09 AM 
Subject: RE: can Flex place focus on browser window already opened with navigateToURL()? 

Yes if you open a new window/tab and pass it a name instead of say "_blank", you can call that window again by its name. I use that technique for changing the navigation(deep-linking) in other web applications that are open. [1], Also I believe if you have a PDF exposed to the web browser you can use hash (#) type navigation to change it to bookmarks or pages in the PDF. 

navigateToURL(new URLRequest("http://www.google.com", "mywindowname"); 


-Mark 

[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL() 


-----Original Message----- 
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Sunday, April 06, 2014 9:54 PM 
To: apache flex users 
Subject: can Flex place focus on browser window already opened with navigateToURL()? 

The first time navitageToURL() is executed, a browser window opens and obtains focus. 

The user views the help file, then goes back to the web app. 

Later, the user clicks to a link that points to a different named destination in the same PDF file. Nothing happens (actually, the PDF file moved to the correct named destination location, but the focus remains in the web app and there nothing noticeable happens). The user has to "know" that he/she must click the browser tab that opened the first time. 

Is there a way that Flex can set focus to the HELP browser window opened with navigateToURL(...,"HELP")? Or how do people address this? Should a popup appear in the web app instructing the user to click on the browser window? etc. 


RE: can Flex place focus on browser window already opened with navigateToURL()?

Posted by ma...@usmc.mil.
Yes if you open a new window/tab and pass it a name instead of say "_blank", you can call that window again by its name.  I use that technique for changing the navigation(deep-linking) in other web applications that are open. [1],  Also I believe if you have a PDF exposed to the web browser you can use hash (#) type navigation to change it to bookmarks or pages in the PDF.

navigateToURL(new URLRequest("http://www.google.com", "mywindowname");


-Mark

[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL()


-----Original Message-----
From: modjklist@comcast.net [mailto:modjklist@comcast.net] 
Sent: Sunday, April 06, 2014 9:54 PM
To: apache flex users
Subject: can Flex place focus on browser window already opened with navigateToURL()?

The first time navitageToURL() is executed, a browser window opens and obtains focus. 

The user views the help file, then goes back to the web app. 

Later, the user clicks to a link that points to a different named destination in the same PDF file. Nothing happens (actually, the PDF file moved to the correct named destination location, but the focus remains in the web app and there nothing noticeable happens). The user has to "know" that he/she must click the browser tab that opened the first time. 

Is there a way that Flex can set focus to the HELP browser window opened with navigateToURL(...,"HELP")? Or how do people address this? Should a popup appear in the web app instructing the user to click on the browser window? etc.