batch operation in function
hey folks,
I have a number of mcs labelled h 1-15. I want to have a function that if someone places an mc on it, it'll lock to the h mc centered. So I'm thinking I'll have a function similar to this (see below). Is there a way to run this without having to do 15 of the else ifs?
function dragchange(e:DisplayObject):void{
if(h1.hitTestPoint(mouseX, mouseY, true)){
TweenMax.to(me,1,{scaleX:0.4,scaleY:0.2,rotation:0});
} else if (h2.hitTestPoint(mouseX, mouseY, true)){
TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
} else if (h3.hitTestPoint(mouseX, mouseY, true)){
TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
} else {
TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
me.x =500
me.y=500
}