In teoria è così:
codice:
istanza_movieclip.onMouseMove = function()
{
if (!this.premuto) {
if (this.hitTest(_root._xmouse, _root._ymouse, false) && !this.aperto) {
if (this._currentframe > (this._totalframes / 2)) {
this.gotoAndPlay(this._totalframes - this._currentframe);
} else {
this.play();
}
this.aperto = true;
} else if (!this.hitTest(_root._xmouse, _root._ymouse, false) && this.aperto) {
if (this._currentframe < (this._totalframes / 2)) {
this.gotoAndPlay(this._totalframes - this._currentframe);
} else {
this.play();
}
this.aperto = false;
}
}
}
istanza_movieclip.onMouseDown = function()
{
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
this.gotoAndStop(11);
_root.comandi(this._parent._name);
this.premuto = true;
}
}
ma avendo il flash mx, puoi usare l'evento onPress e onRollOver al posto del onMouseDown con il controllo sull'hitTest..