# Saving Movie Clip Positions in a simple Drag and Drop Game

**URL:** https://forum.kirupa.com/t/saving-movie-clip-positions-in-a-simple-drag-and-drop-game/324193
**Category:** flash
**Created:** [August 7, 2011, 10:29pm UTC](https://forum.kirupa.com/t/saving-movie-clip-positions-in-a-simple-drag-and-drop-game/324193 "2011-08-07T22:29:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![karlgent](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@karlgent](https://forum.kirupa.com/u/karlgent)
#### Post date: [August 7, 2011, 10:29pm UTC](https://forum.kirupa.com/t/saving-movie-clip-positions-in-a-simple-drag-and-drop-game/324193/1 "2011-08-07T22:29:41Z")

</div>

Hi all,

I was hoping that someone could give me some advice with a game I’ve been working on.

I have a drag and drop game where each movie clip is a word that the player has to arrange on screen in a certain order of importance - there is no snapping mechanism and the user can place the words anywhere desired.

Later in the game, I need this list of words to appear in the order that the player previously organized within a different scene.

I was wondering if anyone had the best solution for me to do this with my limited knowledge of Flash.

This is an example code of how I set up the drag and drop game:

//Array to hold all the puzzle movie clip instances.  
var burgerArr:Array = new Array (burger\_mc, burger2\_mc, burger3\_mc,  
burger4\_mc, burger5\_mc, burger6\_mc, burger7\_mc);

//For loop to control the drag and drop of each burger by adding a  
//mouse up and down to each movie clip.  
for (var i:uint =0; i \< burgerArr.length; i++) {  
burgerArr\*.addEventListener(MouseEvent.MOUSE\_DOWN, drag);  
burgerArr\*.addEventListener(MouseEvent.MOUSE\_UP, drop);  
}

//This function drag the movie clips when the mouse is pressed.  
function drag(event:MouseEvent):void {  
event.currentTarget.startDrag();  
}

//This function drop the movie clips when the mouse is released.  
function drop(event:MouseEvent):void {  
event.currentTarget.stopDrag();  
}  
Any suggestions would be greatly appreciated.

Thanks
