Ciao a tutti , volevo realizzare un effetto carino, il bottone che quando ci si passa con il mouse da il tipico effetto molla , ma non ci riesco. ecco come faccio all'inizio creo il mio movie clip e vi metto su il mio bottone dopo di che posizione il mio mc all'interno dello stage e gli associo il seguente script .
onClipEvent (load) {
k = 0.8;
damp = 0.7;
orgzx = _width;
orgzy = _height;
zx = _width;
zy = _height;
lower = _x-(_width*0.5);
higher = _x+(_width*0.5);
bottom = _y+(_height*0.5);
top = _y-(_height*0.5);
scale = 3;
}
onClipEvent (enterFrame) {
inside = (_root._xmouse>=lower) && (_root._xmouse<=higher);
outside = (_root._xmouse<lower) || (_root._xmouse>higher);
func = (_root._ymouse<top) || (_root._ymouse>bottom);
if (inside) {
zx = orgzx*scale;
zy = orgzy*scale;
}
if (outside) {
zx = orgzx;
zy = orgzy;
}
if (func) {
zx = orgzx;
zy = orgzy;
}
ax = (zx-_width)*k;
vx += ax;
vx *= damp;
_width += vx;
ay = (zy-_height)*k;
vy += ay;
vy *= damp;
_height += vy;
}
qualcuno può aiutarmi