# Slidepuzzel

**URL:** https://forum.kirupa.com/t/slidepuzzel/306428
**Category:** Uncategorized
**Created:** [March 15, 2010, 10:46am UTC](https://forum.kirupa.com/t/slidepuzzel/306428 "2010-03-15T10:46:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RebeccaLessay](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@RebeccaLessay](https://forum.kirupa.com/u/RebeccaLessay)
#### Post date: [March 15, 2010, 10:46am UTC](https://forum.kirupa.com/t/slidepuzzel/306428/1 "2010-03-15T10:46:05Z")

</div>

Hi,

I’m trying to create a variation on the slidepuzzle. When certain areas are uncovered (when set coordinations are not used) you win.

here’s what i got so far:

```auto
var otherBlocks:Array = [1,2,3,4,5,6,7,8,9];

mcsubmit.addEventListener(MouseEvent.CLICK, checkWin);

function checkWin(event:MouseEvent){
//if x = 150, y = 150 not used you win)
	if (x = 150, y = 150 && x = 250, y =250)
		{
		trace ("you win");
		//gotoAndPlay(3);
		}
	else
		{
		trace ("wrong");
		//gotoAndPlay(2);
		}
}

function movement(event:MouseEvent){
	//remove currentblock from array.
	if (event.currentTarget.x += 100 || event.currentTarget.x -=100 || event.currentTarget.y += 100 || event.currentTarget.y -= 100 == y.[otherBlocks] 
	&&|| x.[otherBlocks]){
		}
	else(){event.currentTarget.y += 100 || event.currentTarget.y -= 100 || event.currentTarget.x +=100 || event.currentTarget.x -=100 }
	//depending which position is available you slide there.
	//return new coordinates and start loop again with new coordinates.
}

mcBlock1.Array[1].addEventListener(MouseEvent.CLICK, movement);
mcBlock2.Array[2].addEventListener(MouseEvent.CLICK, movement);
mcBlock3.Array[3].addEventListener(MouseEvent.CLICK, movement);
//etc

```

I’ll appreciate any help or tips on this.
