Align & Distribute Actionscript

Is there a function/library that emulated the align and distrubute functions of the flash environment?
This would be a really useful script for arranging objects dynamically in a flash file.
If there is an existing function could you leave it here. If not I will make one and input is welcome!


public function centerHorizontally(targetMC:Object):Void {
		targetMC._x = Math.round((colorBackground._width/2)-(targetMC._width/2));
}


public function centerVertically(targetMC:Object):Void {
		targetMC._y = Math.round((colorBackground._height/2)-(targetMC._height/2));
}


I actually figured out how to do it better with flade and springs.

If anyone is interested just go to http://www.cove.org/flade/

I don’t really get what I am to do with all of that. I don’t see any readmes or anything.

Well it’s kinda complicated, it’s a physics engine

but you can align stuff by making 2 particles and then putting a spring between them. If you don’t know what particle systems are it might be a bit tricky.

I have put my faith in this 2D particle system because it is really cool. I like that eveything is in one environment, and springs help because they adapt.

Sorry if this doesn’t make sense, I will try to have some real code for you later.

Never used it, but this one looks nice:
demo:
http://www.infragistics.com/design/DesignViewer.html
download (request form):
http://www.infragistics.com/downloads/DownloadRequest.aspx?code=NAISAM

That is cool. Thanks for the post devonair.