...@ipauland.com]
Sent: Saturday, May 09, 2009 11:27 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Try... catch..
I regret my one word answer because while it answers the question, there's a
question of good practice to consider.
Putting return ball; as the last line doesn't really help
...@chattyfig.figleaf.com] On Behalf Of Paul Andrews [
p...@ipauland.com]
Sent: Saturday, May 09, 2009 11:27 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Try... catch..
I regret my one word answer because while it answers the question, there's
a
question of good practice to consider
Hi,
yup
either
public function myBall( value:int ):Ball
{
var ball:Ball
try{
//my code goes here.
return ball;
} catch (e:TypeError ){
trace(Whoops);
}
return null;
Hi Hans,
Thanks for the code :) I have one more question for the script below
1. if catch the TypeError, does the last line = return ball will execute?
Thanks a lot
public function myBall( value:int ):Ball
{
var ball:Ball = null;
try{
//my
Yes.
- Original Message -
From: ACE Flash acefl...@gmail.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, May 09, 2009 3:28 PM
Subject: Re: [Flashcoders] Try... catch..
Hi Hans,
Thanks for the code :) I have one more question for the script below
Sent: Saturday, May 09, 2009 4:17 PM
Subject: Re: [Flashcoders] Try... catch..
Yes.
- Original Message -
From: ACE Flash acefl...@gmail.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, May 09, 2009 3:28 PM
Subject: Re: [Flashcoders] Try... catch
Sure. Reasonable good practice to catch exceptions. I normally use it
for things like catch the exception and try it once again and if it
fails for the second time. I will show an error message or try secondary
option.
Technically, it's good practice/professional to use try-catch-finally
7 matches
Mail list logo