class CL_friendsloader extends Thread{ XMLElement xmlfriends; String tempfriend; PApplet parent; CL_friendsloader(PApplet _parent) { parent=_parent; } public void run() { Curstatus = "Searching Friends of "+activeuser; friendsarray = new String[0]; String getfriends = "http://ws.audioscrobbler.com/1.0/user/"+activeuser+"/friends.xml"; try { xmlfriends = new XMLElement(parent, getfriends); } catch (Exception e) { //println(e); Curstatus = "Connection Lost"; } int numfriends = xmlfriends.getChildCount(); //println(numfriends); if (numfriends >= 1) { //hat der vogel ueberhaupt freunde=? for (int i = 0; i < numfriends; i++) { XMLElement friends = xmlfriends.getChild(i); tempfriend = friends.getStringAttribute("username"); friendsarray = append(friendsarray, tempfriend); //array ausweiten und neue freunde einbauen //println(friendsarray[i]); } } else { Curstatus = "No Friends found"; } doTOMstart(); } }