salut voila j'ai un code qui me permet de faire un easing drag (=smooth) d'un movie clip. le problème c'est qu'il na pas le lock center comme le startdrag. je m'explique avec ce code des que je fais un drag la position de mon movie clip se centre au milieu. moi je ne veux pas ca , je veux pouvoir déplacer mon movie clip a partir de l'endroit ou j'ai cliquer.
pouvez vous m'aider
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 _root.myMC.ease = 2; _root.myMC.targX = _root.myMC._x _root.myMC.targY = _root.myMC._y _root.myMC.onPress = function() { this.drag = true; }; _root.myMC.onEnterFrame = function() { if (this.drag == true) { this.targX = _root._xmouse; this.targY = _root._ymouse; } if (this._x != this.targX | this._y != this.targY) { this._x += (this.targX-this._x)/this.ease; this._y += (this.targY-this._y)/this.ease; } }; _root.myMC.onMouseUp = function() { this.drag = false; };
Partager