----- Original Message ----- From: "Steven Sacks" <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, October 29, 2008 2:20 AM
Subject: Re: [Flashcoders] AS3 - Checking if a Function Exists


Do not call return in a try catch.

Are you suggesting that as bad practice, or because you know the compiler isn't clever enough to sort it out properly?

Ian Thomas wrote:
Method:

    public static function refExists(obj:Object,name:String):Boolean
    {
try
{
            if (obj[name]!=null)
                return true;
}
catch (e:ReferenceError) {}
return false;
    }

HTH,
   Ian

On Tue, Oct 28, 2008 at 8:36 AM, Ian Thomas <[EMAIL PROTECTED]> wrote:
Or, thinking about it, you could catch the reference error in a
try/catch block. It's more of a kludge, but might give you much higher
performance!

Ian

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to