-
Possible or not??
Im wondering if there is a way that I could make a movie clip be able to recognise what has been dragged on to it and have it play the associated sound files for those dragged objects in a sequencial left to right order. If this is within the realm of possibility, does anyone know how it might be done?
Thank you in advance.
Mark Hollas
-
Start by creating an array eg:
seq = Array[];
When you do the start drag....create a variable (eg. curSound) that you can tie to object/sound that is being dragged. When the stop drag is called and if it is released where you want it create use seq.push(curSound); this will add the variable to the array. You will then have an array being built as the sounds are dragged onto the movie. Using a For Next Loop you can then loop through and play each sound. Bit Vague I know but you should get where I'm comin from ;)
-
thank you for that
I can see where you are coming from, I can kinda grasp what I need to do. This will probably require some study on my part. Until recently I have been really only animating with flash. Not so good with the Scripting....
Thanks
-
soundSeq = Array[];
when I put this in I get an output error of
"=" must be followed by an operand.
...what does this mean?
-
try this:
soundSeq=new Array();
or
soundSeq=[];
-
Hehe...oops! Let me know if you need any help
-
that would be nice
Ive been at this for the better part of the day. Im incountering a few problems.
1. setting up a drop target. I cant get this script to return any results.
on (press) {
startDrag(tile_i);
}
on (release) {
stopDrag();
if (tile_i._droptarget ==/DropZone) {
trace("test");
//soundSeq.push();
}
}
I have all my script on the button instances themselves (started the project before I was aware of writing functions on a main "actions" layer)
2. I dont know how, nor can find a tute on associating a sound file to a variable (though am assuming it has something to do with linkages)
as far as the rest goes I have this on my "actions" layer (written after I learned about functions)
soundSeq = Array();
root.button.onRelease = function(){
for(z=0; z<soundSeq; ++z){
trace(soundSeq[z])
}
};
(I figured this would return the name of an attached sound should it be written into the array before the button is pressed. Then when it comes to actually playing it I would use
soundSeq = Array();
root.button.onRelease = function(){
for(z=0; z<soundSeq; ++z){
play();
}
};
This is about the level of understanding I have of scripting. so if anyone could lend a hand. unfortunatly the .fla is too big to upload so here is the general idea again
the goal is for the letter tiles(all Button Instances, and all the drag and drop scripts are written on the buttons themselves) , when lined in the box on the top with the line in it, play in a left to right order (preferably not the order of which they are written into the array, however if that is too difficult, I can simply inform the user in the instructions)
Thank you everybody
-
1 Attachment(s)
I stripped a version of my .fla down, its really bare bones but it will give you the idea.
Thanks