# onPress and while

**URL:** https://forum.kirupa.com/t/onpress-and-while/121704
**Category:** Uncategorized
**Created:** [September 6, 2004, 1:10am UTC](https://forum.kirupa.com/t/onpress-and-while/121704 "2004-09-06T01:10:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jazzman121](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jazzman121/32/127_2.png) [@jazzman121](https://forum.kirupa.com/u/jazzman121)
#### Post date: [September 6, 2004, 1:10am UTC](https://forum.kirupa.com/t/onpress-and-while/121704/1 "2004-09-06T01:10:39Z")

</div>

```auto

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

```auto
 
&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
