Actionscript 3.0 help

Hello everyone,

I was wanting some help with some of my coding I have to complete a game designed to teach students how to build a food web. This is my first use of flash Everything was going fine till I decided to go a bit more complex with the actionscript. What I have the program doing so far is when the sun2_mc1, sun2_mc2, sun2_mc3 and sun2_mc4 movieclips are pressed they turn into buttons and can be dragged. When the mc’s are over the top of the target of - “target” + event.target.name - and the mouse is unpressed the mc is left in that position. At the moment the coding needs to have the mc over the exact same target of targetsun2_mc1 etc. However, I need the mc to be able to be placed over the top of all four of the targets on the background.

If you understand what I am asking your help will be much appreciated. Here is the coding ive got so far:


 
var startX2:Number;
var startY2:Number;
 
sun2_mc1.addEventListener(MouseEvent.MOUSE_DOWN,pickUp2);
sun2_mc1.addEventListener(MouseEvent.MOUSE_UP,dropIt2);
sun2_mc2.addEventListener(MouseEvent.MOUSE_DOWN,pickUp2);
sun2_mc2.addEventListener(MouseEvent.MOUSE_UP,dropIt2);
sun2_mc3.addEventListener(MouseEvent.MOUSE_DOWN,pickUp2);
sun2_mc3.addEventListener(MouseEvent.MOUSE_UP,dropIt2);
sun2_mc4.addEventListener(MouseEvent.MOUSE_DOWN,pickUp2);
sun2_mc4.addEventListener(MouseEvent.MOUSE_UP,dropIt2);
 
//PICKUP AND DROP FUNCTIONS
function pickUp2(event:MouseEvent):void {
 event.target.startDrag(true);
 event.target.parent.addChild(event.target);
 startX2 = event.target.x;
 startY2 = event.target.y;
}
function dropIt2(event:MouseEvent):void {
 event.target.stopDrag();
 var myTargetName:String = "target" + event.target.name;
 var myTarget:DisplayObject = getChildByName(myTargetName);
 if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
  event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp2);
  event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt2);
  event.target.buttonMode = false;
  event.target.x = myTarget.x;
  event.target.y = myTarget.y;
 } else {
  event.target.x = startX2;
  event.target.y = startY2;
 }
}
sun2_mc1.buttonMode = true;
sun2_mc2.buttonMode = true;
sun2_mc3.buttonMode = true;
sun2_mc4.buttonMode = true;