onClipEvent(load){
initL=_width;
initH=_height
initR=_rotation
initx=_x
inity=_y
speed=5
}
onClipEvent(enterFrame){
if(_root.startclip and _root.startclip!=undefined and _root.palla._x >_x){
_width=_root.palla._x-_x;
_height=_root.palla._y-_y
angolo_radianti=Math.atan((_root.palla._y-inity)/(_width));
_rotation= angolo_radianti/Math.PI*180;
}
if(!_root.startclip and _root.startclip!=undefined and _root.palla._x >_x){
//azioni per elastico
if (_width >initL){
_width=_width+(initL-_width)/speed;
}
if (_height >initH and _width < initL){
_height=_height+(initH-_height)/speed;
}
// modifiche per muovere la palla
_root.palla._x=initx+_width
if (_root.palla._y >= inity){
_root.palla._y=inity+_height}
else{_root.palla._y=inity-_height}
}
}