Application recovery in testtry-catch and catch
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute">
<Mx: button x = "10" Y = "10" id = "btn1" label = "showerror" Click = "showerror ()" fontsize = "12"/>
<Mx: button x = "10" Y = "63" label = "button" width = "95" Click = "continuemute ()" fontsize = "12"/>
<Mx: SCRIPT>
<! [CDATA [
Import MX. Controls. Alert;
VaR Tarr: array;
Public Function showerror (): void
{
VaR astr: string;
Try
{
Astr = Tarr. tostring (); // Tarr is an uninitialized array and the reference is null.
}
Catch (E: Error)
{
Trace (E); // output: argumenterror: Error #2024: an object may not be added as a child of itself.
Tarr = [];
Tarr. Push ("");
Btn1.label = "XXX ";
Alert. Show (E. tostring ());
Continuemute ();
}
}
Public Function continuemute (): void
{
Alert. Show ("continuemute:" + Tarr. tostring ());
}
]>
</MX: SCRIPT>
</MX: Application>