Вам нужно создать событие click для мувиклипа и записать его в переменную, по которой кликнул мувиклип, а затем, когда щелкнет второй, вы просто поменяете их местами. Я дам вам фрагмент кода, который должен работать и должен быть достаточным, чтобы научить вас, как это делается.
import flash.events.MouseEvent;
// Variable that will be used to store the 1st clicked MC
var lastClickedSwapMC;
//First we define the function to be called
function clickEventSwapMcs(evt : MouseEvent) {
// Verify if a mc wasn't previously clicked
if(lastClickedSwapMC == null) {
// If it wasn't, it's the 1st time, so store the MC that was clicked
lastClickedSwapMC = evt.currentTarget;
} else {
// If it was, we just need to swap the positions of the stored one with the one just clicked
var savedX : Number = evt.currentTarget.x;
var savedY : Number = evt.currentTarget.y;
evt.currentTarget.x = lastClickedSwapMC.x;
evt.currentTarget.y = lastClickedSwapMC.y;
lastClickedSwapMC.x = savedX;
lastClickedSwapMC.y = savedY;
//After swaping their position, we clear the last clicked MC
lastClickedSwapMC = null;
}
}
//Now we register the click event on them so it calls the function
mc1.addEventListener(MouseEvent.CLICK, clickEventSwapMcs);
mc2.addEventListener(MouseEvent.CLICK, clickEventSwapMcs);