onClipEvent (load) {
bounce = new Sound(this);
dynaSounds = new Sound();
leftBoundary = 150;
rightBoundary = 400;
topBoundary = 220;
bottomBoundary = 300;
boundaryHeight = bottomBoundary-topBoundary;
boundaryWidth = rightBoundary-leftBoundary;
quadrantSize = boundaryWidth/2;
centerPoint = rightBoundary-quadrantSize;
}
onClipEvent (mouseMove) {
if (_root._xmouse>leftBoundary && _root._ymouse>topBoundary && _root._xmouse<rightBoundary && _root._ymouse<bottomBoundary) {
startDrag(this, true);
topToBottomPercent = ((((_root._ymouse-topBoundary)/boundaryHeight)*100)/2)+50;
bounce.setVolume(topToBottomPercent);
this._xscale = topToBottomPercent;
this._yscale = topToBottomPercent;
panAmount = ((_root._xmouse-centerPoint)/quadrantSize)*100;
bounce.setPan(panAmount);
} else {
stopDrag();
}
}
onClipEvent (mouseDown) {
randomSound = random(3);
randomLoop = random(2) + 1;
dynaSounds.attachSound("Sound"+randomSound);
dynaSounds.start(0, randomLoop);
}
onClipEvent (keyDown) {
dynaSounds.stop();
}