im trying to create a Loop based piece of music software... i have got the basics down, and it is working as i want it to.. the problem is that i want to trigger my audio files on "key up". each key triggering a different sample from the cast e.g key 'A" plays drum loop 1, key "B" plays drum loop 2......
people have given me scripts for key up e.t.c. but i'm having big problems implimenting them ( just coz i'm a beginner)
can anyone give me some help, "in fairly simple english",
do i add the script to the cast members or to the script channel, if it is the script channel can i add it to the "hold on current frame" script, or do i have to work around that??
You could do it in various ways, but maybe the easiest is to add the 'on keyUp' handler to a Movie Script. Just open up the Script Window in Director and past the 'on keyUp' handler into it. You can name the script up at the very top of that window in a separate editable text box.
When you close the Script Window, you will see that your Cast has a new script in it with the name you gave it. I'm not sure, but I think newly created scripts default to being Movie Scripts. In any case, you can right click on the script in the cast window and select 'Cast member properties'. This brings up the Property Inspector. That'll tell you whether the script is a Movie Script, a Parent Script, or a Behavior.
Movie scripts don't get attached to sprites and they don't serve as frame scripts. They just sit in the cast. And if they have an 'on keyUp' handler in them, the handler will execute. Though you might want to have a look at the Lingo Dictionary and its entry concerning 'keyUp' for more detail about that.
The only potential problem you might run into concerning placement in a movie script is that you might want your 'on keyUp' handler to just run in certain parts of the movie, not throughout the entire movie.
If this is the case, then maybe putting it in a behavior script and making that behavior a frame script would be better.
Best wishes with the piece, Ben, hope it's funky!