title: How do I reference two dynamic objects when checking for collision?
body: <p>I can't figure out how to get information on which slot the letter is dropped above, so the letters only snaps to the last slot, because it's the only one referenced properly. Can anyone tell me a method to check which object(slot) the letter is dropped above? The two kinds of movieclips I create are simply a background for the letter and a slot to drop it in.</p>
  
  <pre><code>var myFormat:TextFormat = new TextFormat();
      myFormat.color = 0xFFFFFF;
      myFormat.font = "Verdana";
      myFormat.size = 35;  
      myFormat.bold = true;
      myFormat.align = TextFormatAlign.CENTER;
  
  var myString:String = "firefly"
  myString = myString.toUpperCase();
  var myArray:Array = myString.split('');
  
  for(var i:Number = 0; i &lt; myString.length; i++) {
  
      var myBogstav:bogstav = new bogstav();
      var myBogstavSlot:bogstavSlot = new bogstavSlot();
  
      var myText:TextField = new TextField();
      myText.selectable = false;
      myText.width = 50;
      myText.height = 50;
  
      addChild(myBogstavSlot);
      addChild(myBogstav);
      myBogstav.addChild(myText);
  
      myText.defaultTextFormat = myFormat;
      myText.text = myArray[i];
  
      myBogstavSlot.name = "bogstavSlot" + i;
      myText.name = "bogstav" + i;
      myBogstav.name = "bogstavBG" + i;
  
      myBogstavSlot.x = i*60 + 10;
      myBogstavSlot.y = myBogstav.y - 100;
      myBogstav.x = i*60 + 10;
  
      myBogstav.addEventListener(MouseEvent.MOUSE_DOWN, ClickToDrag);
      myBogstav.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
  }
  
  var startPosition:Point;
  
  function ClickToDrag(event:MouseEvent):void
  {
      setChildIndex(event.target.parent, numChildren - 1);
      event.target.parent.alpha = 0.6;
  
      startPosition = new Point(event.target.parent.x, event.target.parent.y);
  
      event.target.parent.startDrag();
  }
  
  function releaseToDrop(event:MouseEvent):void
  {   
      setChildIndex(event.target.parent, 0);
      event.target.parent.alpha = 1;
      event.target.parent.stopDrag();
  
      if (event.target.parent.hitTestObject(MovieClip)){
          event.target.parent.x = MovieClip.x;
          event.target.parent.y = MovieClip.y;
  
      } else {
          event.target.parent.x = startPosition.x;
          event.target.parent.y = startPosition.y;
      }
  }
  </code></pre>
  
  <p>Any help is much appreciated.</p>