# Scrolling background transitions

**URL:** <https://forum.kirupa.com/t/scrolling-background-transitions/261187>\
**Category:** flash\
**Created:** [May 23, 2008, 11:28pm UTC](https://forum.kirupa.com/t/scrolling-background-transitions/261187 "2008-05-23T23:28:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axauv](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Axauv](https://forum.kirupa.com/u/Axauv)\
**Post date:** [May 23, 2008, 11:28pm UTC](https://forum.kirupa.com/t/scrolling-background-transitions/261187/1 "2008-05-23T23:28:48Z")

</div>

im trying to do a very simple side scrolling background for a game- and it works perfectly- but i’d like to load up a different image after a while, so i made a “stitched” image (frame called transition) and a second background wall which i want to take over and replace the first one-

the wall itself is a 3 frame movie clip, the first wall, the stitch, then the second wall. here is my code:

```
if (Key.isDown(Key.RIGHT)) {
        if (crouching == false) {
            wall._x -= 10;
            player_mc.gotoAndStop("walk");
            if (wall._x&lt;=800) {
                walliteration++;
                if (walliteration == 2) {
                    wall.gotoAndStop("transition");
                    transition = true;
                }
                if (transition == true) {
                    wall.gotoAndStop("wall2");
                    walliteration -= 50;
                }
                wall._x = 1600;
            }

```

the var walliteration is supposed to count up everytime the scrolling background resets, so you walk for a while then it loads the second image… but its’ not working it just scrolls the first background image forever (which is wall.frame1)
