# I have no idea what is going on

**URL:** <https://forum.kirupa.com/t/i-have-no-idea-what-is-going-on/322693>\
**Category:** flash\
**Created:** [May 31, 2011, 1:56am UTC](https://forum.kirupa.com/t/i-have-no-idea-what-is-going-on/322693 "2011-05-31T01:56:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joecoolman](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@joecoolman](https://forum.kirupa.com/u/joecoolman)\
**Post date:** [May 31, 2011, 1:56am UTC](https://forum.kirupa.com/t/i-have-no-idea-what-is-going-on/322693/1 "2011-05-31T01:56:13Z")

</div>

It makes me angry. The code is simple and doesn’t work.  
In a timeline of a movie I wrote:

1. 

```
for (i=1; i&lt;6; i++) {

```

2. wave.duplicateMovieClip(“wave”+i,30+i);

3. }

4. 
5. function initposition(wn,xmax){

6. for (s=1; s\<6; s++) {

7. this[wn+s].\_x = xmax+15\*s;

8. this[wn+s].\_y = 80;

9. if (this[wn+s].\_x\>xmax) {

10. 

```
this[wn+s]._visible = 0;

```

11. 

```
}

```

12. }

13. }

14. function movetoleft(wn, xmin, xmax) {

15. for (j=1; j\<6; j++) {

16. \_root[wn+j].\_x = \_root[wn+j].\_x-2;

17. etc etc etc

18. }

19. initposition(“wave”,170);

20. moviwave = setInterval(movetoleft,50,“wave”,31,170);

Why my friends? why? (crying) Why if I change ‘\_root’ by ‘this’ in line 24 nothing happens? furthermore, if I put trace(this[wn+j].\_x) in line 25 the output is ‘undefined’, but in line 20 the output shows the correct values.

I’ll be grateful for any help.

joe:hr:
