I’m developing a desktop app on flash AS3 (AIR 2). I’m using HTMLLoader to populate whit html content from my server, on the HTML content there’s an input field alone whit a button where a users can input an email and when submit is pressed (using a html form) then the app content changes to a welcome screen whit a minified one week calendar that highlights activities for that user alone (pulled from a database). This minified calendar is clickable and here’s where mi conflict lies.
For the form button to work properly I must have navigateInSystemBrowser set to false, but when the usr clicks some date link I must have navigateInSystemBrowser set to true… obviously I cannot have it doing both tings at the same time, or can I?… so I tried to put the form field elements within flash to send the email inside a var so that php can process and send to the minified calendar but I haven’t been able to get it to work.
There should be a tag like type or name, you know openIn=”” to give each link or anchor the option to open inside or outside the app instead of relying on navigateInSystemBrowser.
Searching I came across some almost useful links.
http://forums.adobe.com/message/3230376
But it gives no light on the possible solution.
This is the code I posted last time, hope the writing up there helps to better describe my conflict.
Thanks’ for any help given.
import flash.html.*;
import flash.net.*;
var cargador:HTMLLoader = new HTMLLoader();
var url:URLRequest = new URLRequest("myhtmlcontent.php");
cargador.load(url);
addChild(cargador);
cargador.paintsDefaultBackground = false;
cargador.width = stage.stageWidth - 0;
cargador.height = stage.stageHeight - 0;
cargador.cacheResponse = true;
cargador.navigateInSystemBrowser = true; //
cargador.useCache = true;
cargador.authenticate = false;
cargador.manageCookies = true;
OK, I found the answer, well at least its working for me and this is how I fixed the issue.
On the initial post I wrote:
There should be a tag like type or name, you know openIn=”” to give each link or anchor the option to open inside or outside the app instead of relying on navigateInSystemBrowser.
Well it so happens that there is something like that, and its well commented in here http://forums.adobe.com/thread/435864
There are probably a couple of ways to do it. Essentially, you would need to capture the click on the link (or a related event), get the target URL and use the flash.net.navigateToURL() function.
It worked for me and This is what I did:
On each link You want to open on the system browser you put this:
And the AS3 as follow:
Here I leave the code for those who might need something like it.