In strict sense, AS3 does not allow you to do function overloading.

The link that you point to is something like "Do function overloading by
hook or by crook". What it does it that it defines a single function,
wherein you check for the object type, and based on that call different
functions.

To elaborate a bit more -- it defines a base function, which takes its
argument an "Object" class. Since the "Object" class is a super class for
all the classes in AS, you can cast any class into this. Then in your
function you typecast this "Object" to the appropriate class, and call the
corresponding function that you have defined for it.

Since you are putting in so much of type checking effort, you might as well
call each of these functions directly.

Cheers,
Kapil


On Sun, Jul 4, 2010 at 7:08 PM, Sidhu Vijay Sidhu <[email protected]>wrote:

>
> http://www.darronschall.com/weblog/2003/09/method-overloading-in-actionscript-2.cfm
>
> Can you check this link about overoading in as....but i am not sure what he
> is doing explain it if u can
>
> On Sat, Jul 3, 2010 at 11:46 PM, kannan leo <[email protected]> wrote:
>
>> I think we cant do any overloading in AS3.0, correct me if I am wrong
>>
>>  On Sat, Jul 3, 2010 at 8:38 PM, Sidhu Vijay Sidhu 
>> <[email protected]>wrote:
>>
>>> Can we do overloading in ActionScript 3.0?  if yes can anbdy send me the
>>> example or the way how to do it
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Flex India Community" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<flex_india%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/flex_india?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<flex_india%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to