It has to wait until the textare is loaded before I could use it. So the function should looks like this:
IEnumerator LoadTexture(string url) {
WWW www = new WWW(url);
while (!www.isDone){
yield return null;
}
loaded = www.texture;
}