ActionScript.org Flash, Flex and ActionScript Resources - http://www.actionscript.org/resources
Continuously Looping Background
http://www.actionscript.org/resources/articles/21/1/Continuously-Looping-Background/Page1.html
Roy Haryanto
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org. 
By Roy Haryanto
Published on September 9, 2005
 
Written by: Roy Haryanto
Difficulty Level: begining
Requirements: Flash 4

Page 1 of 2
Written by: Roy Haryanto
Difficulty Level: begining
Requirements: Flash 4

Download FLA
Part 1



Have you ever wanted to create a continuously looping background so that it seems the foreground object is in perpetual motion?

This tutorial will explain clearly how easy it is to achieve that. After reading this tutorial some expert users of Flash will comment that we can save trouble by using actionscript. Well I did not say we can't but this tutorial is meant for beginners, targetting those who only realised the existence of Macromedia Flash a few days ago.

So without further ado, let us start the tutorial.

The first step is to add 30 frames to the layer. This can be done by clicking on the first frame of the layer and press F5 until there are 30 frames.

The next step is to import the graphic object which is going to be used as the background.

File > import
Select the backgound image (in this case sky.jpg)
Then click Open.

By now you should have picture of a sky in the centre.



Duplicate the Image
We need to duplicate the picture so that it fills up the screen.

Click on Ctrl+C to copy the image into clipboard and Ctrl+V (3 times) to add 3 more pictures of the sky. If you only see 1 copy of the image it likely that the 4 images are on top of each other. Drag one image to each of the 4 corners and try to align them so that the overall image looks continuous.



We have to duplicate this combined image and align the copy beside the original.
Edit > Select All, Ctrl+C to copy the combined image and Ctrl+V to paste it onto the screen.
Again, the images should be aligned next to each other to form a long continuous rectangular image.

Page 2 of 2

PART 2

Add Key Fames
Right-click anywhere between the first frame and last frame and Create Motion Tween.
Add a keyframe to the last frame.
Right click on last frame and Insert Keyframe OR Click on last frame + F6.
By now the jagged line on the layer would have transformed into a long smooth arrow.



Click on the last frame, and drag the image for the distance of half its width to the left.



Loop the Image
The final step is the most crucial part. In this step the image is looped so that it runs continuously.

Right click on last frame > Properties > Click on Action tab , the + sign, Go To





Click on Go to and Play, and make sure the values for Scene and Frame are <current scene> and Number 1 respectively.
Click on OK.