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