Edit: I think I misread your question. I thought you were asking for a looping background.
In case you might find this useful anyways I'll my answer here. Correct me if I'm wrong though!
You can either create a bitmap with a resolution of your stage size and process the edges to loop ( takes a bit a of a script for this but they are out there).
Or you create 9 sprites/bitmaps that are repositioned depending on the cameras position. Creating an illusion of endless loops.
I hope this makes any sense:
Direction is the movement of your camera, thus the position of the camera changes.
The base is the center of your camera or character ( if it's in the center at least).
So basically you define the position of each background piece by dividing the position by the width and height of the screen
var baseX:int = int(center.x / cellWidth) * cellWidth; // Ensures a clean integer;
var baseY:int = int(center.y / cellHeight) * cellHeight;
Now you loop trough your sprites/bitmaps with a double forloop( because you are working with rows here)
I might have made a mistake but it looks something like this
for (var y:int = 0; y < 3; y++)
for (var x:int = 0; x < 3; x++)
bitmaps[y][x].x = baseX + (y * cellWidth); // Cell width and height
bitmaps[y][x].y = baseY + (x * cellHeight);// are the sizes of the pieces
Use a 2D array, it's easier due to the nature of your rows and columns.
Here is an example of a 4x4 grid. Obviously the cells are suppose to be bigge so that you don't see them jump around:
Use arrow keys.