Ciao ciao, usando il seguente codice ottengo l'effetto VR a 360°; mi trovo però a dover creare alcuni VR che non vanno oltre i 180°, tornerebbe quindi utile che il VR partisse dal grado 0 e permettesse la rotazione fino al grado X. Troppo complicato modificare il codice del 360°? Resto in attesa d'illuminazioni...
Grazie.
onClipEvent (load) {
lVX = this._x;
lVY = this._y;
pP = true;
ce = _root.cornice._x;
h = this._height;
bl = false;
}
onClipEvent (mouseDown) {
dr = true;
}
onClipEvent (mouseUp) {
dr = false;
pP = true;
_root.c1.removeMovieClip();
_root.c2.removeMovieClip();
_root.riga._visible = false;
c = 0;
bl = false;
}
onClipEvent (enterFrame) {
cnt = this.getBounds(_root);
mL = this._width/2;
pV = cnt["xMin"]+mL;
ceD = ce-pV;
pD = ceD/mL*100;
if (_root._xmouse>_root.cntC["xMin"] and _root._xmouse<_root.cntC["xMax"] and _root._ymouse<_root.cntC["yMax"] and _root._ymouse>_root.cntC["yMin"] and dr) {
if (pP) {
_root.riga._visible = false;
_root.cerchietto.duplicateMovieClip("c1", 1);
_root.cerchietto.duplicateMovieClip("c2", 2);
_root.riga._x = _root._xmouse;
_root.riga._y = _root._ymouse;
pMA = _root._xmouse;
pMAY = _root._ymouse;
_root.c1._x = _root._xmouse;
_root.c1._y = _root._ymouse;
pMB = pMA;
pP = false;
} else {
pMB = _root._xmouse;
pMBY = _root._ymouse;
}
c++;
if (c>1) {
_root.riga._visible = true;
}
_root.c2._x = _root._xmouse;
_root.c2._y = _root._ymouse;
dstY = _root.c1._y-_root.c2._y;
dst = pMB-pMA;
distY = pMBY-pMAY;
_root.riga._xscale = dst;
_root.riga._yscale = distY;
this._x -= dst/_root.rX;
if (cnt["yMin"]<_root.cntC["yMin"] and cnt["yMax"]>_root.cntC["yMax"] and !bl) {
this._y += dstY/_root.rY;
}
if (this._x<lVX-this._width/3 or this._x>lVX+this._width/3) {
this._x = lVX;
}
if (cnt["yMin"]>=_root.cntC["yMin"]) {
bl = true;
this._y--;
}
if (cnt["yMax"]<=_root.cntC["yMax"]) {
bl = true;
this._y++;
}
}
}