I want to have a continously looping background in my movie in such a way that there is no gap in the start and end of background movieclip when the timeline jumps from the end frame to the starting one!!
Create a movie clip slightly larger then your background.
Bring a second copy of the movie clip onto the stage and place it just to the side of the first one.
Then use action script to move the two movie clips over.
As one leaves the background area, use action script to relocate it on the other side of the other movie clip. and so on and so on
I modified the script where the background Movieclip has 4 frames with a different background image to give it some more interst. The if statement on frame1 of the timeline randomly sets the background's frame.
I also increased the frame rate, as this makes things much smoother.
As in Geezer's script, you of course need to add a mask above the background layer. I just put a frame so you can see what is going on better.
I am kinda confused here cuz i am a new person at this, how do u use the action script? Could one of u guys walk me through, step by step, of how to do this looping background? that would be helpful
I didn't go thru the whole tutorial, but it looks like a good one.
In the example that Geezer gave you, he isnt using any actionScript at all. He mearly has a movie clip that tweens from up to down. made a second copy of it, and placed it directly above the first. and put a mask over it all.
I modified the script where the background Movieclip has 4 frames with a different background image to give it some more interst. The if statement on frame1 of the timeline randomly sets the background's frame.
I also increased the frame rate, as this makes things much smoother.
As in Geezer's script, you of course need to add a mask above the background layer. I just put a frame so you can see what is going on better.
I tried using your .fla to create something similar but there's still a gap between the end of the mc2 and beginning of mc1....
What am I doing wrong??
I am posting my fla in case you wouldn't mind taking a look at it....
Your background image is centered on its orgin point.
Open up your backgound movie clip and click on the bitmap.
In your properties panel, you will see that x and y are -395,-52.
You can do one of two things.
1) change the x and y to 0,0 and rearrange your clips on the maintime line.
(actually the y coordinate makes no difference in this example)
or
2) you can change the action script to account for the -395: 795-395=400
Your background image is centered on its orgin point.
Open up your backgound movie clip and click on the bitmap.
In your properties panel, you will see that x and y are -395,-52.
You can do one of two things.
1) change the x and y to 0,0 and rearrange your clips on the maintime line.
(actually the y coordinate makes no difference in this example)
or
2) you can change the action script to account for the -395: 795-395=400
Thank you! I knew it had something to do wuith the positioning of the mc but just couldn't figure what or why.....
Thanks....now off to finish up the movies.....
Your background image is centered on its orgin point.
Open up your backgound movie clip and click on the bitmap.
In your properties panel, you will see that x and y are -395,-52.
You can do one of two things.
1) change the x and y to 0,0 and rearrange your clips on the maintime line.
(actually the y coordinate makes no difference in this example)
or
2) you can change the action script to account for the -395: 795-395=400
I must have screwed it up somehow.....I changed what you said and the first round is fine then after that there si a huge gap between the two mcs every time.....
I can be contacted offlist at ftarzwell at fayec dot com in case you prefer.
Although I think this is a good learning tool for the other =s who will eventually ask the same question....
What do you use to calculate the value of x in that mc?
your bg_2 x coordinate is at 783. Since you are subtracting 5 each time. And the if statement is absolute, x==400, the second clip will never meet the condition, and will continue to scroll to the left.
You can change the x coordinate to 785 of bg_2 and the script will work.
or
I realize you are trying to make the border slightly smaller to get even bands, so you can probally clean up your image in a graphics editor.
or
with the bg_2 at 783, I tried using 'if (this._x<-400)' and it sort of work too, but it looked like the border differed slightly each time.
Yes, of Course.. If all you want to do is scroll the same image. Then putting two images with tweens works fine. And no action script involved at all. Very Simple indeed.
I like the action script method because you can then start to use different images on each pass. In fact with a little more math, you can scroll different size images. But, there's no reason to use it, unless that is your intent.