Export a png from texture2D

Hi,

i am basically combining all the textures into one but also need to export the texture file out.

this was working before but no longer does, probably because i updated to unity v4 (need this to work for editor,android, iphone and webplayer

newTexture.Apply ();
		
		byte[] bytes = newTexture.EncodeToPNG ();
		 System.IO.File.WriteAllBytes (Application.dataPath + "/../testscreen-" + ".png", bytes);

ERROR = System.IO.File’ does not contain a definition for `WriteAllBytes’

ok from some looking around IO does not work for web player