# Could you trouble-shoot this code pls?

**URL:** <https://forum.kirupa.com/t/could-you-trouble-shoot-this-code-pls/306872>\
**Category:** Uncategorized\
**Created:** [March 23, 2010, 7:43pm UTC](https://forum.kirupa.com/t/could-you-trouble-shoot-this-code-pls/306872 "2010-03-23T19:43:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hihello](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@hihello](https://forum.kirupa.com/u/hihello)\
**Post date:** [March 23, 2010, 7:43pm UTC](https://forum.kirupa.com/t/could-you-trouble-shoot-this-code-pls/306872/1 "2010-03-23T19:43:59Z")

</div>

basically I am trying to use an array, with forEach, in order to drag two objects … below is my code but doesn’t seem to work, i am not pretty good in as3 so I doubt there’s a flaw in it somewhere i couldn’t figure out. would much appreciate your help. Thanks.

```auto
var dragMC:Array=new Array("contentMC","bgMC");
 
function backgroundFunctions(bgMC:Sprite) {
    dragStageF(bgMC);
     dragFunctStart(dragMC);
    dragFunctStop(dragMC);
}

function dragFunctStart(dragMC:Array) {
     startDrag();
      bgMC.addEventListener(Event.ENTER_FRAME,tile.updateStageF);
 }
  function dragFunctStop(dragMC:Array) {
     stopDrag();
      bgMC.removeEventListener(Event.ENTER_FRAME,tile.updateStageF);
}

function dragStageF(bgMC:Sprite) {
     startDragF = function(e:Event){
     dragMC.forEach(dragFunctStart);
     };
      stopDragF = function(e:Event){
     dragMC.forEach(dragFunctStop);
      };
     bgMC.addEventListener(MouseEvent.MOUSE_DOWN,startDragF);
      bgMC.addEventListener(MouseEvent.MOUSE_UP,stopDragF);
 }

```
