Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
how can i detect that default browser has been launched completely, here is my plan.
task is to open a web link when user opens the application and when that web link has been loaded completely in browser i want to close my application
has successfully opened the web link, currently application is closing after certain amount of time which is not that logical.

What I have tried:

import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.display.NativeWindow;

function evnt_window_initPosition(event:Event) {//starting position
stage.nativeWindow.x=(Capabilities.screenResolutionX - this.width)/2;
stage.nativeWindow.y=(Capabilities.screenResolutionY - this.height)/2;
}
stage.addEventListener(Event.ACTIVATE, evnt_window_initPosition);

var _counter:int=0;
var _myurl:URLRequest=new URLRequest("http://e.dunya.com.pk/index.php?e_name=isl");
 navigateToURL(_myurl, "_blank");
stage.addEventListener(Event.ENTER_FRAME,onenterframe);
function onenterframe(e:Event):void
{
_counter++;
if(_counter==150)
{
NativeApplication.nativeApplication.exit();
}
} 

update:added in code block
Posted
Updated 29-Sep-16 19:04pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900