Hi,
demo is not online - this version had lot of programming bugs… merging cubes takes lot of memory (1 gb)... It was created in away3d 4.0.0.9 (or ...0.1) beta, If I find source code of it, I will post it here.
Better way to do this terrain is directly to molehill (agal). I created this one
photos - https://www.facebook.com/media/set/?set=a.549469845063140.130509.296644877012306&type=1&l=8f6a8a16cf
live demo - http://agal.geardice.com/ (with pseudethread, generate without freezing UI - http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html)
Every vertex have XYZ position, UV, and RGB color,... then in AGAL you code that vertex is showed like Texture + RGB (I created that way shadows and ambient occlusion). Then you create only faces what you need.
Terrain I am generating via perlin noise http://www.houseofthead.com/blog/flash-as3-perlin-noise-explained-and-demonstrated-part-1/
Just for example, if you want terrain 20*20*160 cubes,.. generate 20*20 perlin noise,... and then pick pixel at 0,0 from bitmap (in which is generated perlin noise), than calculate picked color from range 0xffffff and 0x000000 and from this percentage create height of terrain at 0,0 (for example picked color is 0x888888 its 50% then terrain at 0,0 is 80 cubes height (50% from 160)). And this repeat in loop for every height.
Best way is create 16x16xHEIGHT mesh with cubes, and then other one.
Cave system is generated by 3D perlin noise (google it).
Everything what you need about molehill and agal is in this book
http://www.packtpub.com/adobe-flash11-stage3d-molehill-game-programming-beginners-guide/book
Michal Deak