# Fake function overloading

**URL:** <https://forum.kirupa.com/t/fake-function-overloading/309845>\
**Category:** Uncategorized\
**Created:** [May 26, 2010, 1:01am UTC](https://forum.kirupa.com/t/fake-function-overloading/309845 "2010-05-26T01:01:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [May 26, 2010, 1:01am UTC](https://forum.kirupa.com/t/fake-function-overloading/309845/1 "2010-05-26T01:01:08Z")

</div>

I want a generic function that lets me align a child object to the bottom edge of a parent object. The problem is that the parent object can either be a simple movie clip or the Stage. With Stage, I would have to use the stageHeight property rather than the normal height propery.

```php

public static function alignBottom1(child:MovieClip, container:Stage):void
{
   child.y = container.stageHeight - child.height;
}

public static function alignBottom2(child:MovieClip, container:MovieClip):void
{
   child.y = container.height - child.height;
}

```

I know actionscript has no function overloading, but is there any fake way to overload, so that I won’t have to juggle between two functions all the time?
