Вот весь скрипт
Смысл следующий: имеется картинка
при переносе на определённую ячеку (таких ячеек 5) выдаётся сообщение правильно,
мимо - не правильно, ведётся подсчёт.
Для 1,2,3 работает нормально для 5-го нормально для 4-го криво
если я убираю 5-й или 4-й мувик ячейку в кординально другое место - работает, возвращаю - опять криво

Код:
var i = 2;
j = 1;
k=1;
Result_1 = new Array(96);
Result_2 = new Array(96);
//Result2 = new Array(96);
for (var i=1; i<=96; i++)
{
Result_1[i]='';
Result_2[i]='';
}
//----------------------------------------------------------------------------------
_root.muhSamBel.onPress = function() {
attachMovie("muhSamBel", "muhSamBel"+i, i, {_x:0, _y:0});
_root.n1 = "i: "+i;
_root["muhSamBel"+i].startDrag(true);
};
_root.muhSamBel.onRelease = _root.muhSamBel.onReleaseOutside=function () {
// _root.n2 = "i: "+ i;
_root["muhSamBel"+i].stopDrag();
if ((_root["muhSamBel"+i]._x>XY_b._x) and (_root["muhSamBel"+i]._x<(XY_b._x+XY_b._width)) and (_root["muhSamBel"+i]._y>XY_b._y-20) and (_root["muhSamBel"+i]._y<(XY_b._y+XY_b._height)) or
(_root["muhSamBel"+i]._x>XY_b5._x) and (_root["muhSamBel"+i]._x<(XY_b5._x+XY_b5._width)) and (_root["muhSamBel"+i]._y>XY_b5._y-20) and (_root["muhSamBel"+i]._y<(XY_b5._y+XY_b5._height)) or (_root["muhSamBel"+i]._x>XY_b2._x) and (_root["muhSamBel"+i]._x<(XY_b2._x+XY_b2._width)) and (_root["muhSamBel"+i]._y>XY_b2._y-/*20*/5) and (_root["muhSamBel"+i]._y<(XY_b2._y+XY_b2._height)) or (_root["muhSamBel"+i]._x>XY_b3._x) and (_root["muhSamBel"+i]._x<(XY_b3._x+XY_b3._width)) and (_root["muhSamBel"+i]._y>XY_b3._y-5) and (_root["muhSamBel"+i]._y<(XY_b3._y+XY_b3._height)) or (_root["muhSamBel"+i]._x>XY_b4._x) and (_root["muhSamBel"+i]._x<(XY_b4._x+XY_b4._width)) and (_root["muhSamBel"+i]._y>XY_b4._y-5) and (_root["muhSamBel"+i]._y<(XY_b4._y+XY_b4._height))) {
if ((_root["muhSamBel"+i]._y>XY_b._y-20) and (_root["muhSamBel"+i]._y<(XY_b._y+XY_b._height))) {
_root["muhSamBel"+i]._x = XY_b._x+XY_b._width/2+15;
_root["muhSamBel"+i]._y = XY_b._y+12;
// +XY_B._height/2;
_root["muhSamBel"+i]._height = _root["muhSamBel"]._height*0.5;
_root["muhSamBel"+i]._width = _root["muhSamBel"]._width*0.5;
}
if ((_root["muhSamBel"+i]._y>XY_b2._y-5) and (_root["muhSamBel"+i]._y<(XY_b2._y+XY_b2._height))) {
_root["muhSamBel"+i]._x = XY_b2._x+XY_b2._width/2+5;
_root["muhSamBel"+i]._y = XY_b2._y;
// +XY_B._height/2;
_root["muhSamBel"+i]._height = _root["muhSamBel"]._height*0.5;
_root["muhSamBel"+i]._width = _root["muhSamBel"]._width*0.5;
}
if ((_root["muhSamBel"+i]._y>XY_b3._y-5) and (_root["muhSamBel"+i]._y<(XY_b3._y+XY_b3._height))) {
_root["muhSamBel"+i]._x = XY_b3._x+XY_b3._width/2+18;
_root["muhSamBel"+i]._y = XY_b3._y;
// +XY_B._height/2;
_root["muhSamBel"+i]._height = _root["muhSamBel"]._height*0.5;
_root["muhSamBel"+i]._width = _root["muhSamBel"]._width*0.5;
}
if ((_root["muhSamBel"+i]._y>XY_b4._y-5) and (_root["muhSamBel"+i]._y<(XY_b4._y+XY_b4._height))) {
_root["muhSamBel"+i]._x = 50;//XY_b4._x+XY_b4._width/2+5;
_root["muhSamBel"+i]._y = XY_b4._y;
_root["muhSamBel"+i]._height = _root["muhSamBel"]._height*0.5;
_root["muhSamBel"+i]._width = _root["muhSamBel"]._width*0.5;
}
if ((_root["muhSamBel"+i]._y>XY_b5._y-20) and (_root["muhSamBel"+i]._y<(XY_b5._y+XY_b5._height))) {
_root["muhSamBel"+i]._x = XY_b5._x+XY_b5._width/2+15;
_root["muhSamBel"+i]._y = XY_b5._y+12;
_root["muhSamBel"+i]._height = _root["muhSamBel"]._height*0.5;
_root["muhSamBel"+i]._width = _root["muhSamBel"]._width*0.5;
}
Result_1[j] = j;
Result_2[j] = "Правильно";
if (j<=6)
{
k=0
}
else if (j<=12)
{
k=1
}
else if (j<=18)
{
k=2
}
else if (j<=24)
{
k=3
}
else if (j<=30)
{
k=4
}
else if (j<=36)
{
k=5
}
else if (j<=42)
{
k=6
}
else if (j<=48)
{
k=7
}else if (j<=54)
{
k=8
}
else if (j<=60)
{
k=9
}
else if (j<=66)
{
k=10
}
else if (j<=72)
{
k=11
}
else if (j<=78)
{
k=12
}
else if (j<=84)
{
k=13
}
else if (j<=90)
{
k=14
}
else if (j<=96)
{
k=15
}
for (var n = (j-6*k); n<=6; n++) {
_root["ResNum"+n] = '';
_root["ResName"+n] = '';
}
_root["ResNum"+(j-6*k)] = Result_1[j];
_root["ResName"+(j-6*k)] = Result_2[j];
// ---------------------
attachMovie("Rezult1", "Rezult", 5, {_x:_root._width/2, _y:_root._height/2});
onEnterFrame = function () { if (Key.isDown(1)) {removeMovieClip(Rezult);_root.P1.removeMovieClip();}};
i++;
j++;
} else {
removeMovieClip(_root["muhSamBel"+i]);
Result_1[j] = j;
Result_2[j] = "Не правильно";
if (j<=6)
{
k=0
}
else if (j<=12)
{
k=1
}
else if (j<=18)
{
k=2
}
else if (j<=24)
{
k=3
}
else if (j<=30)
{
k=4
}
else if (j<=36)
{
k=5
}
else if (j<=42)
{
k=6
}
else if (j<=48)
{
k=7
}else if (j<=54)
{
k=8
}
else if (j<=60)
{
k=9
}
else if (j<=66)
{
k=10
}
else if (j<=72)
{
k=11
}
else if (j<=78)
{
k=12
}
else if (j<=84)
{
k=13
}
else if (j<=90)
{
k=14
}
else if (j<=96)
{
k=15
}
for (var n = (j-6*k); n<=6; n++) {
_root["ResNum"+n] = '';
_root["ResName"+n] = '';
}
_root["ResNum"+(j-6*k)] = Result_1[j];
_root["ResName"+(j-6*k)] = Result_2[j];
// ---------------------
j++;
attachMovie("Rezult2", "Rezult", 5, {_x:_root._width/2, _y:_root._height/2});
onEnterFrame = function () { if (Key.isDown(1)) {removeMovieClip(Rezult);}};
}
};
//*************************************
//кнопка перемотки таблицы
_root.verh.onPress = function() {
if (k>0){
k--
kr=k;
for (var i=1; i<=6; i++)
{
_root["ResNum"+i] =Result_1[i+6*k];//j-2;
_root["ResName"+i] =Result_2[i+6*k];//j-2;
} }
}
//*************************************
//кнопка перемотки таблицы вниз
_root.niz.onPress = function() {
if (k<=4){
kr=k;
for (var i=1; i<=6; i++)
{
_root["ResNum"+i] =Result_1[i+6*k];//j-2;
_root["ResName"+i] =Result_2[i+6*k];//j-2;
}
k++}
};