public static function center():Void
{
var targetClip:MovieClip = MovieClip(arguments.shift());
var i:Number = arguments.length;
while (i--)
{
arguments[i]._x = targetClip._x + (targetClip._width / 2);
arguments[i]._y = targetClip._y + (targetClip._height / 2);
}
}
Even more optimized
public static function center():Void
{
var targetClip:MovieClip = MovieClip(arguments.shift());
centerX:Number = targetClip._x + (targetClip._width / 2);
centerY:Number = targetClip._y + (targetClip._height / 2);
var i:Number = arguments.length;
while (i--)
Hello :)
you don't limit your while loop instruction ?
while ( --i -1)
{
}
EKA+ :)
2007/5/11, Steven Sacks [EMAIL PROTECTED]:
Even more optimized
public static function center():Void
{
var targetClip:MovieClip = MovieClip(arguments.shift());
centerX:Number = targetClip._x +
3 matches
Mail list logo