# Sliding images puzzle "game" - Help!

**URL:** <https://forum.kirupa.com/t/sliding-images-puzzle-game-help/229685>\
**Category:** flash\
**Created:** [June 19, 2007, 2:37pm UTC](https://forum.kirupa.com/t/sliding-images-puzzle-game-help/229685 "2007-06-19T14:37:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonzy](https://avatars.discourse-cdn.com/v4/letter/b/8e7dd6/32.png) [@bonzy](https://forum.kirupa.com/u/bonzy)\
**Post date:** [June 19, 2007, 2:37pm UTC](https://forum.kirupa.com/t/sliding-images-puzzle-game-help/229685/1 "2007-06-19T14:37:33Z")

</div>

Greetings,

The “game” I need to make consists of 1 large (vector) image split up into 4 rows. The user is to arrange each row (one at a time only, top to bottom) so that the picture is completed. Upon each row completion, a message is displayed and the user moves on to the next row.

I have the basics down in Flash, and I can move the image pieces horizontally with keyboard arrows. The only thing I need help with is how to specify when each picture slice hits a certain X coordinate to “goto” a keyframe, load a movie, whatever need be…

The code I have thus far:

watchKeyBoard = new Object();  
watchKeyBoard.onKeyDown = function() {  
trace("a key is pressed. the key that is pressed is "+Key.getAscii());  
};  
Key.addListener(watchKeyBoard);  
function moveStuff() {  
if (Key.isDown(Key.LEFT)) {  
this.\_x -= 5;  
}  
if (Key.isDown(Key.RIGHT)) {  
this.\_x += 5;  
}  
}  
box\_mc.onEnterFrame = moveStuff;
