AS does not support overloading but we can use variable arguments
feature in AS like shown below:

public function myFunction(...args)
{
  //all my passed arguments will be supplied in array args;

}

myFunction(10);
myFunction(10,20);
myFunction(10,20,30);

and so on...but all the arguments should be of same type. We can also
pass arraycollections if we want. Also in case your function is taking
multiple arguments/parameters the var-args one should be last..I mean
like

public function myFunction(event:Event,..args)
{
}

I hope that will help.

Thanks,
Akhil
On Aug 7, 8:06 am, BalthaPraveen Kumar <[email protected]> wrote:
> it suuport overloading Concep By Using ...r();
> function;
>
> in  ...r[0] refers First Object;
>
> ...r[1] refers 2nd Object;
>
>
>
>
>
>
>
>
>
> On Sun, Aug 7, 2011 at 1:38 PM, rajjnd <[email protected]> wrote:
> > No currently it's not possible for function overloading like c# or
> > java does.
>
> > On Aug 7, 12:06 am, kamal <[email protected]> wrote:
> > > Hi All,
> > > is actioncript3 supports function overloading?
> > > Thank you,
> > > Kamal
>
> > --
> > 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.
>
> --
> B.Praveen Kumar

-- 
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