so I have a code to ping a server, but it traces the information. I want to change that, and use dynamic text to display that ping information on the stage. How would I do that? Here is my code:
var ldr:URLLoader = new URLLoader();
ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus);
var url:String = "URL-TO-SITE";
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();
trace("got response in", time_stop - time_start, "ms");
}
times++;
if(times < limit) doThePing();
}
Im not sure if this is what you are asking, but if you want to show the information that is being traced right now, you have to have a textfield on the stage, or create one dynamically. You could do it like this you want to make a text field: