Load movie clip between 2 x positions

Hi,

I’ve just added in a bubble effect I found here.

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?