So here we will prepare our flash movies on the stage.

First, create a shape (i chose a star) and convert it into a movie name it "obj" and check the Export for ActionScript this will be the replacement of the content and it will be dynamiclly attached into our container movie clip.

Second, create a rectangle shape 100x100px and convert it into a movie name it bg and give it the instance name bg_mc. Then convert this instance into another movie clip name it container and set its instance  to container_mc.
all the converts must have the registered point at the top left of the movie clip.

third, create three layers "script", " scroller", "content"
in the content place the container_mc movie clip
scroller leave it blank we will use it in the next page
and in the script layer insert this code

//--Stage aligned top left
Stage.align = "TL";
//--Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
//--Create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = setStage;
function setStage() {
 var w=Stage.width;
 var h=Stage.height;
 container_mc.bg_mc._width=w-100;
 container_mc.bg_mc._height=Math.random()*10*h;
 container_mc.init(20);
 container_mc._x=50;
 container_mc._y=0;
 scroller_mc._x = w-1;
 scroller_mc._y = 0;
 scroller_mc.bg_mc._height = h;
// we will explain this in the next page
 scroller_mc.updateScroll(container_mc._height+50);
}
Stage.addListener(sizeListener);
setStage();


this code hase a listner for the resize event of our movie so when the movie is resized the function setStage will be called i think the code is understandable we are just aligning stuff and redimension them.

Now in the container Movie clip create a new layer where we will put the code for the randomly attached content which will be the code below:
holder_mc = this.createEmptyMovieClip('holder', this.getNextHighestDepth());
function init(n) {
//remove the old stars holder
 holder_mc.removeMovieClip();
//create a new one
 holder_mc = this.createEmptyMovieClip('holder', this.getNextHighestDepth());
//attach the shapes
 for (i=0; i<n; i++) {
  depth = holder_mc.getNextHighestDepth();
  temp = holder_mc.attachMovie('obj', depth, depth);
  temp._x = random(this._width-100);
  temp._y = random(this._height-100);
 }
}


let go to the next page to code our scroller.