/ Published in: ActionScript

Useful for product showcases
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//sulla clip filmato che contiene i 60 fotogrammi,fare in modo che quando facciamo click col mouse, l'omino faccia uno scatto di sei gradi, cioè prosegua di un fotogramma onClipEvent (load) { stop(); } onClipEvent (mouseDown) { if (_currentframe == _totalframes) { gotoAndStop(1); } else { nextFrame(); } } //fare in modo che quando il mouse si muove l'omino si giri in quella direzione onClipEvent (mouseMove) { xmouse = _root._xmouse; if (xmouse>=_width*0.6) { dv = 1; } else if (xmouse<=_width*0, 4) { dv = -1; } else { dv = 0; } } onClipEvent (enterFrame) { frame_finale = _currentframe+dv; if (frame_finale<1) { frame_finale = _totalframes; } else if (frame_finale>_totalframes) { frame_finale = 1; } gotoAndStop(frame_finale); }
Comments
