# Setting x and y for multiple pieces

**URL:** <https://forum.kirupa.com/t/setting-x-and-y-for-multiple-pieces/29346>\
**Category:** Uncategorized\
**Created:** [August 25, 2003, 9:49pm UTC](https://forum.kirupa.com/t/setting-x-and-y-for-multiple-pieces/29346 "2003-08-25T21:49:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Big\_Red](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@Big\_Red](https://forum.kirupa.com/u/Big_Red)\
**Post date:** [August 25, 2003, 9:49pm UTC](https://forum.kirupa.com/t/setting-x-and-y-for-multiple-pieces/29346/1 "2003-08-25T21:49:39Z")

</div>

I am very new to flash mx and actionscript. I am trying to create a puzzle made up of nine pieces each named piece1, piece2 etc. each is a movie clip with an imbedded button. I am trying to make the pieces scramble upon load and be dragable, but I want to have them return to their original x and y coordinates when the viewer presses a button. Help! Im in over my head. Plus If anyone can suggest an online learning program I can get into that is really good.

thanks,  
Big Red

P.S.  
this is my first post

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 26, 2003, 10:23pm UTC](https://forum.kirupa.com/t/setting-x-and-y-for-multiple-pieces/29346/2 "2003-08-26T22:23:39Z")

</div>

Hi,

You need something like this when you press the button to put everything back.

piece1.\_x = origX1;  
piece1.\_y = origY1;  
.  
.  
.  
piece9.\_x = origX9;  
piece9.\_y = origY9;

Good luck,

Liz

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2003, 7:47pm UTC](https://forum.kirupa.com/t/setting-x-and-y-for-multiple-pieces/29346/3 "2003-08-27T19:47:22Z")

</div>

this tute might help u 🙂

[http://www.flashkit.com/tutorials/Actionscripting/Basic/Drag\_\_D-estudiow-863/index.php](http://www.flashkit.com/tutorials/Actionscripting/Basic/Drag__D-estudiow-863/index.php)
