onPress and while


loadText = new LoadVars();
loadText.load("data.php?"+random(999));

loadText.onLoad = function() {

i=0;
        while(i<30) {
                _root.movieclip["b"+i].onPress = function() {
                _parent.blacktext.text = loadText["datas"+i];
	   }
                i++;
        }

}

This code basically takes varaibales from php page that outputs this

 
&datas0=test&datas1=testtest 
  ........ all the way to  ..&datas29=testtesttest

anyways this doesnt work… doesnt anyone know why? when i click the button in flash i want the corresponding datas ( data ) to show up… in blacktext.text

please help…

i hope that makes sense

put a trace in the onLoad and see if it shows up.
if it doesnt (i think it will not) put the onload in the next frame.

if it does, put a trace in the onPress

and instead of loadText use _parent.loadText

the onLoad works thats for sure… if i place

_root.movieclip.b1.onPress

it works fine…