# Movieclip troubles

**URL:** <https://forum.kirupa.com/t/movieclip-troubles/278004>\
**Category:** flash\
**Created:** [December 20, 2008, 12:22am UTC](https://forum.kirupa.com/t/movieclip-troubles/278004 "2008-12-20T00:22:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcafaro10](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jcafaro10](https://forum.kirupa.com/u/jcafaro10)\
**Post date:** [December 20, 2008, 12:22am UTC](https://forum.kirupa.com/t/movieclip-troubles/278004/1 "2008-12-20T00:22:50Z")

</div>

Hello,

I’m trying to create a simple sound wave effect in AS 2.0. I have an object moving and generating a soundwave everyonce in awhile but when it goes off the side I want the object and soundwave to appear on the other side. Here’s what I tried

```auto

function cleanUp()
{
 ct = 0;
 for(var mc in this)
 {
  if(mc == "sound")
  {
   ct++;
   trace("MOVING"+this[mc]+" number "+ct+" from "+this[mc]._x);
   this[mc]._x = 0;
  }
 }
}

```

If I produce the first soundwave right as the object is about to go off the stage, everything appears on the other side of the screen correctly. However, all other soundwaves after that do not appear on the other side of the screen. I create soundwaves with this function:

```auto

function showMovie(linkageId, xpos, ypos,rot) 
{
    var linkageId :String;
    var xpos:Number;
    var ypos:Number;
    myMovie = this.createEmptyMovieClip(linkageId, this.getNextHighestDepth());
    myMovie._x = xpos;
    myMovie._y = ypos;
 myMovie.attachMovie(linkageId,e,this.getNextHighestDepth());
}

```
