Hittest -- drag to defined Y position

Hi ,

i got 4 movie’s on main (category0_mc, category1_mc, category2_mc and category3_mc) the _y position of these 4 movie’s is variable…

i want it so that when i start drag “categorie0_mc” you only can drag to (category1_mc, category2_mc and category3_mc) and when release “categorie0_mc” change _y position with the other categorie movie

i searched and find some things, but not usefull for me…

if somebody could point me to a tutorial or give a hint :d

thanks

Something like this?


for (i=0;i<=4;i++){
   _root["categorie"+i+"_mc"].onRelease = function () {
        if (_root["categorie"+i+"_mc"].hitTest(categorie1_mc){
        _root["categorie"+i+"_mc"]._y = cateogrie1_mc._y;
        }
        if (_root["categorie"+i+"_mc"].hitTest(categorie2_mc){
        _root["categorie"+i+"_mc"]._y = cateogrie2_mc._y;
        }
       \\and so on... There maybe a more elegant way to script this.. :p
    }
}