joshtynjala I am not sure if thats what I was looking for -
var tst:Toast;
tst = new Toast();
tst = Toast.showMessage(text.toUpperCase(), delay, skinnedToastFactory);
tst.addEventListener(starling.events.Event.CLOSE,onToastRemoved);
toastArray.push(tst);
private function onToastRemoved(event:Event):void {
var len:int = toastArray.length;
for (var i:int = 0; i < len; i++){
if(toastArray[i] == event.currentTarget ){
LogMan.log("Toast {0} Removed",toastArray[i].message);
toastArray[i].removeEventListener(starling.events.Event.CLOSE,onToastRemoved);
toastArray.splice(i,1);
LogMan.log("Total Toasts Remaining = {0} ", toastArray.length);
break;
}
}
}
the issue I am facing with above code is that, there are scenarios where toast is not getting disposed and is getting stuck on the screen!
Unfortunately I am not able to reproduce it from my end, but I do have users complaining about the same!