PDA

View Full Version : turntabel scratch


felix.fuchs
05-12-2002, 08:45 PM
i am trying to programm a turntable that the users can scratch with. does anyone know how to programm this? i have seen it a few times, but i am not sure, if it has to be done with director...
i tried making a mc with sound in and the timeline of the mc is controlled with _xmouse. the soudn set on stream.. but then there is no sound..
would love to have some help on my challenge...

JHallam
05-13-2002, 12:22 AM
Ok, little hard to explain, but here goes..

Thick of the concepts of the drag function, basically get your turntable in to MC, aminate the disc spinning to 30 frames loop then use a drag basic


onClipEvent (mouseDown) {
orgX = _xmouse;
dragging = true;
orgFr = _currentframe;
}
onClipEvent (mouseMove) {
if (!dragging) {
return;
}
newX = _xmouse;
shift = int((newX-orgX)/8);
fr = orgFr+shift;
if (fr<1) {
fr += 30;//edit frames if your amination is +30
}
if (fr>30) {
fr -= 30;//same here
}
gotoAndStop (fr);
updateAfterEvent();
}
onClipEvent (mouseUp) {
dragging = false;
}


That should run fine, top of head might have syntax error but not that I can see, so after assigning that to the clip you can get the sounds on drag from your libary.

then edit the above script to speed the sound up or something, anyhow, thats the movement etc now you work out the sound which isnt too hard either :)

good look

farafiro
05-13-2002, 08:48 AM
hey GRaPHiX_FReaK what is that code supposed to do??

felix.fuchs
05-13-2002, 09:08 AM
thanx for it so far...
the script works fine, but the same result with what i did before: the anim runs with sound, as soon as i start scratching, it stops.....
any hints how to control the sound?

JHallam
05-14-2002, 01:16 AM
Originally posted by farafiro
hey GRaPHiX_FReaK what is that code supposed to do??

You know that 3d car I shown you before Alfred? where you can drag it to spin it around, basically similar concept, as you drag it runs the amination through the frames ;)

Originally posted by felix.fuchs
thanx for it so far...
the script works fine, but the same result with what i did before: the anim runs with sound, as soon as i start scratching, it stops.....
any hints how to control the sound?

Okay, do a search here for Drag sound or something, see if it has been covered but gimme some time to sort my work out at uni (busy lately - when is it not lol) anyhow, I'll create an example for you if you still can't work the sound out.