So I made a program that will load some text in a dynamic text box, called text_Box. Then I also made a button called reset_btn. I am not sure how to code this, but I want the user to be able to click the button, and the dynamic text_Box will reset, and run through their code again (to get their text). Basically I want to close the program, without actually closing it haha. So all the actions, and code re-run on a click of a button. Or what some people may call, to "Flush" an application. Can someone please help me on this? Thanks in advanced!
var ldr:URLLoader = new URLLoader();
ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus);
var url:String = "http://google.com";
var limit:int = 10;
var time_start:Number;
var time_stop:Number;
var times:int;
ping();
function ping():void
{
trace("pinging", url);
times = 0;
doThePing();
}
function doThePing():void
{
time_start = getTimer();
ldr.load(new URLRequest(url));
}
function ldrStatus(evt:*):void
{
if(evt.status == 200)
{
time_stop = getTimer();
textBox.text = String(time_stop - time_start);
}
}