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.
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);
}