Dynamically change stage size depending on content height

Hi guys

I’m asking myself how I resize (or tween-resize) the size of a flash movie depending on its content.

Take a look at: http://www.pierinc.com
When you click on a new page, the stage size resizes depending on how large the page is.

Do I have to use javascript to do this (because I can’t find the javascript on the pier website to take a look at it).
Or can I do this with actionscript?

Thanks in advance
Arcko Drazen