I am making a cloud background continuously loop using actionscript, however the image cuts itself off. I cannot figure out what the problem is. I was following the tutorial at: http://www.pixelhivedesign.com/tutorials/Endless+Scrolling+Background/
I attached a picture of what it looks like. Here’s my code(very similar to above websites code)
animator = createEmptyMovieClip('animator',1);
bg_1 = animator.attachMovie('cloudsMC','bg_1',1);
bg_2 = animator.attachMovie('cloudsMC','bg_2',2);
bg_1._x = -bg_1._width/2;
bg_2._x = bg_2._width/2;
speed = 25;
cloudWidth = 1500;
animator.onEnterFrame = function(){
bg_1._x -= speed;
bg_2._x -= speed;
if(bg_1._x <= -bg_1._width) bg_1._x = cloudWidth;
if(bg_2._x <= -bg_2._width) bg_2._x = cloudWidth;
}
This code is all in a movieclip named bg_mc.
The width of cloudsMC is 1500 px.
Any idea why the image cuts off as it scrolls to the left?