# Load movie clip between 2 x positions

**URL:** <https://forum.kirupa.com/t/load-movie-clip-between-2-x-positions/252428>\
**Category:** Uncategorized\
**Created:** [February 20, 2008, 1:12am UTC](https://forum.kirupa.com/t/load-movie-clip-between-2-x-positions/252428 "2008-02-20T01:12:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GGMcGee](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@GGMcGee](https://forum.kirupa.com/u/GGMcGee)\
**Post date:** [February 20, 2008, 1:12am UTC](https://forum.kirupa.com/t/load-movie-clip-between-2-x-positions/252428/1 "2008-02-20T01:12:14Z")

</div>

Hi,

I’ve just added in a bubble effect I found [here](http://www.actionscript.org/showMovie.php?id=1078).

At the moment the script creates bubbles randomly across the whole width of the stage.

I want the effect to only occur between two x positions, say 50 and 845, on the stage.

This is the Actionscript I have at the moment.

> 

function bubbles(){

```
xpos = Stage.width*(Math.random());
xpos = Math.round(xpos);

_root.attachMovie("bubble", "bubble"+xpos, 999+xpos);
    
_root["bubble"+xpos]._x = xpos;
_root["bubble"+xpos]._y = 299;

```

}

interval1 = setInterval(bubbles, 50);

Can someone help me out please?
