I have a URLRequest loading on a mobible device. If the internet is spotty it stops. Most of the time it works but sometimes it gets stuck on a certain percentage. Is there a way to see if the loading has stopped and have it "retry" after 3 seconds or something of that sort? Can it also try like, lets say, 10 times and after that throw an error message so I can tell users?
public function loadIt()
{
var theImage = "http://www.Example.com/Example.png"; // real url not given here
my_loader.load(new URLRequest(theImage));
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener);
my_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
if(autoPlayAd=="true")
{
playAd();
}
}
public function progressListener(e:ProgressEvent):void
{
loadingStatus.Per.text = Math.floor((e.bytesLoaded/e.bytesTotal)*100)+ "%";
}