Okay, so essentially I’m trying to have a box which objects can be dragged into, and upon pushing a play button, the sounds attached to the objects which have been dragged into the box will play simultaneously. My code follows, with play being the button and everything else being an object which is drag/droppable. For some reason, pushing the play button will only play two specific sounds, no matter how many or which objects are within the box. In my minimalistic coding mind, this should work, but it just isn’t–help, please…?
play.onRelease = function() {
mar8 = new Sound();
mar8.attachSound("3_8mp3");
mar18 = new Sound();
mar18.attachSound("3_18mp3");
mar19 = new Sound();
mar19.attachSound("3_19mp3");
mar22 = new Sound();
mar22.attachSound("3_22mp3");
apr9 = new Sound();
apr9.attachSound("4_9mp3");
apr10 = new Sound();
apr10.attachSound("4_10mp3");
apr13 = new Sound();
apr13.attachSound("4_13mp3");
apr15 = new Sound();
apr15.attachSound("4_15mp3");
apr27 = new Sound();
apr27.attachSound("4_27mp3");
may1 = new Sound();
may1.attachSound("5_1mp3");
if ("_root.3_8", hitTest("_root.TargetBlock")) {
mar8.start(0, 1);
}
if ("_root.3_18".hitTest("_root.TargetBlock")) {
mar18.start(0, 1);
}
if ("_root.3_19", hitTest("_root.TargetBlock")) {
mar19.start(0, 1);
}
if ("_root.3_22", hitTest("_root.TargetBlock")) {
mar22.start(0, 1);
}
if ("_root.4_9", hitTest("_root.TargetBlock")) {
apr9.start(0, 1);
}
if ("_root.4_10", hitTest("_root.TargetBlock")) {
apr10.start(0, 1);
}
if ("_root.4_13", hitTest("_root.TargetBlock")) {
apr13.start(0, 1);
}
if ("_root.4_15", hitTest("_root.TargetBlock")) {
apr15.start(0, 1);
}
if ("_root.4_27", hitTest("_root.TargetBlock")) {
apr27.start(0, 1);
}
if ("_root.5_1", hitTest("_root.TargetBlock")) {
may1.start(0, 1);
}
}