Hi
I'd like to know how, if possible, how to cancel a ProgressEvent.PROGRESS or how do cancel the 'loading' process in general.
I also want to know how to do it from another class, what happens is I create a 'loading window' with a cancel button so you should be able to cancel if the loading is taking too long for your liking.
var msg:msgClass = new msgClass();//*********** Creates a window with message if any errors happen.
var winLoading:winLoadingClass = new winLoadingClass();//*********** Creates a window with a loading bar and cancel button
winLoading.win()//***********activates loading window
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
dispatcher.addEventListener(Event.COMPLETE, completeHandler)
function completeHandler(event:Event){winLoading.winClose()}
function progressHandler(event:ProgressEvent):void{if (event.bytesLoaded == event.bytesTotal){winLoading.winClose()}}
function securityErrorHandler(event:SecurityErrorEvent):void{msg.win('Security Error');}
function httpStatusHandler(event:HTTPStatusEvent):void{if (event.status != 200){msg.win('Connection to server lost');}}
function ioErrorHandler(event:IOErrorEvent):void{winLoading.winClose();msg.win ('IO Error');}
Any help will be much appreciated
North America
Europe, Middle East and Africa
Asia Pacific