Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 8

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 11

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 14

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 105

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 105

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 105

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 106

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 106

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 108

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 108

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 108

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 108

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 108

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 109

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 109

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 109

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 109

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 111
 Forum Panda Pirate
Forum Grenier xIF  
Panda Pirate, forum rôliste

Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 39
Lisez d'abord la FAQ, svp =>[ FAQ ] [ Thread Index ] [ Search ] [ Archives ] [ Pandapirate ]

Topic: [aidez-moi!] Ya-t-y quelqu'un qui parle courament ActionScript?
Posted by: Pogo at jeu. 15 févr. 2007 12:52:05

Keywords: Sun shines down, so come to town, set your body free.

Message:

Parce que voilà. Je sue sur un script somme toute assez con, mais vu que je suis assez nul, j'ai un problème.

En gros: j'ai un clip d'animation représentant un personnage, appelé Soldier, dont l'instance sur la scène est appelée Soldier1. Ce clip représente, en 16 images, un soldat tournant sur lui-même en isométrique.

Le but du script est que 1) je chope la position du pointeur de la souris et que 2) je choisisse l'image qui correspond pour que le soldat regarde le pointeur. Simple, non?

Bah non, parce le soldat se met à tourner sur lui-même dès que le pointeur apparaît à l'écran et que j'ai beau checké où je me suis gourré, je vois pas.

Le code (piqué honteusement de "ActionScript pour FlashMX, la Référence" chez O'reilly que Bubu m'a aimablement passé y'a des lustres et que si il veut le récupérer, il me le dit, et adapté à ma sauce pour remplacer la fonction Rotation par un choix d'image du clip selon l'angle horizon/ligne soldat-souris):

soldier1.gotoAndStop(1);
_global.radiansEnDegres = function(radians) {
return (radians/Math.PI) * 180;
}
MovieClip.prototype.rotationVersPointeur = function() {
var point = {x:this._x, y:this._y};
this._parent.localToGlobal(point);
var deltaX = _root._xmouse - point.x;
var deltaY = _root._ymouse - point.y;
var rotationRadian = Math.atan2(deltaY, deltaX);
var rotationAngle = radiansEnDegres(rotationRadian);
switch (true) {
case (rotationAngle >= 348 && rotationAngle < 12):
_this.gotoAndStop(9);
break;
case (rotationAngle >= 12 && rotationAngle < 33):
_this.gotoAndStop(10);
break;
case (rotationAngle >= 33 && rotationAngle < 56):
_this.gotoAndStop(11);
break;
case (rotationAngle >= 56 && rotationAngle < 78):
_this.gotoAndStop(12);
break;
case (rotationAngle >= 78 && rotationAngle < 101):
_this.gotoAndStop(13);
break;
case (rotationAngle >= 101 && rotationAngle < 123):
_this.gotoAndStop(14);
break;
case (rotationAngle >= 123 && rotationAngle < 146):
_this.gotoAndStop(15);
break;
case (rotationAngle >= 146 && rotationAngle < 168):
_this.gotoAndStop(16);
break;
case (rotationAngle >= 168 && rotationAngle < 191):
_this.gotoAndStop(1);
break;
case (rotationAngle >= 191 && rotationAngle < 213):
_this.gotoAndStop(2);
break;
case (rotationAngle >= 213 && rotationAngle < 236):
_this.gotoAndStop(3);
break;
case (rotationAngle >= 236 && rotationAngle < 258):
_this.gotoAndStop(4);
break;
case (rotationAngle >= 258 && rotationAngle < 281):
_this.gotoAndStop(5);
break;
case (rotationAngle >= 281 && rotationAngle < 303):
_this.gotoAndStop(6);
break;
case (rotationAngle >= 303 && rotationAngle < 326):
_this.gotoAndStop(7);
break;
case (rotationAngle >= 326 && rotationAngle < 348):
_this.gotoAndStop(8);
break;
default:
_this.gotoAndStop(9);
break;
}
}
soldier1.onEnterFrame = rotationVersPointeur;

Voili-voilou. Merci d'avance si qqu'un panne quelque chose.




Warning: Undefined variable $link in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 98

Fatal error: Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, null given in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php:98 Stack trace: #0 /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php(98): mysqli_query(NULL, 'SELECT rootID, ...') #1 /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php(52): displayThread('93169') #2 {main} thrown in /home/clients/13eaf4559a54d78787520f07cab62616/web/panda/archreply.php on line 98