AS3 Drag and Drop multiple objects - improving code suggestion
Hi, i want to improve my code for drag drop
seven different or multiple objects to be moved in any three of target places
then target value will be search by category or feature wise,
any suggestion will be welcome in helping writing the code.
this drag n drop code work but i want to improve it, pls guide thks
Quote:
//--------------------------------
//---------------Romantic--------------
//--------------------------------
romantic.addEventListener(MouseEvent.MOUSE_DOWN, romantic_pick);
romantic.addEventListener(MouseEvent.MOUSE_UP, romantic_drop);
romantic.buttonMode = true;
//---functions
//--------------------------------
//--------------------------------
function romantic_pick(event:MouseEvent):void {
romantic.startDrag(true);
if(romantic.x > 894 && romantic.x < 989 && romantic.y > 97 && romantic.y < 229)
{
msg.text = "";
}}
//--------------------------------
//--------------------------------
//--------------------------------
function romantic_drop(event:MouseEvent):void {
romantic.stopDrag();
boxone_romantic();
}
//------------------------------------
//--------------------------------
//--------------------------------
//--------------------------------
function smallsize_romantic()
{
romantic.width = 50;
romantic.height = 75;
}
//--------------------------------
//--------------------------------
//--------------------------------
function boxposition1_romantic()
{ romantic.x =540;
romantic.y =225;
msg1.text = "Romantic";
option= 1;
romantic.rotation=-9.3;
romantic.removeEventListener(MouseEvent.MOUSE_DOWN , romantic_pick);
romantic.removeEventListener(MouseEvent.MOUSE_UP, romantic_drop);
romantic.buttonMode = false;
}
//--------------------------------
//--------------------------------
//--------------------------------
function boxposition2_romantic()
{ romantic.x =550;
romantic.y =300;
msg2.text = "Romantic";
option=2;
romantic.rotation=-9.3;
romantic.removeEventListener(MouseEvent.MOUSE_DOWN , romantic_pick);
romantic.removeEventListener(MouseEvent.MOUSE_UP, romantic_drop);
romantic.buttonMode = false;
}
//--------------------------------
//--------------------------------
//--------------------------------
function boxposition3_romantic()
{ romantic.x =560;
romantic.y =365;
msg3.text = "Romantic";
option=3;
romantic.rotation=-9.3;
romantic.removeEventListener(MouseEvent.MOUSE_DOWN , romantic_pick);
romantic.removeEventListener(MouseEvent.MOUSE_UP, romantic_drop);
romantic.buttonMode = false;
}
//--------------------------------
//---------------------