Accueil > Horloge |
version v4 |
12/11/2006 |
|
Il faut mettre le dernier fichier "macros_sys.txt"
< télécharger
> dans le répertoire d' E-anim : " C:\Program Files\e-anim701\doc\macros\ " , sauvegardez l'ancien avant la mise en place de ce fichier. |
Un groupe nommé "sinus": 12 objets (ronds jaunes centrés, bille1 a bille12. 12 variables (h1 a h12). Un groupe nommé "heure_V7": (rectangle bleu sous les heures/minutes...) // heures "phhours"; 0; 0; "Date";code_40( ); "getHours"; code_52( ); code_1D( ); // ---------------------------------------------------- // minutes "phminuts"; 0; 0; "Date";code_40( ); "getMinutes"; code_52( ); code_1D( ); // ---------------------------------------------------- // secondes "phsecondes"; 0; 0; "Date";code_40( ); "getSeconds"; code_52( ); code_1D( ); // ---------------------------------------- // millisecondes "phmillis"; 0; 0; "Date";code_40( ); "getMilliseconds"; code_52( ); code_1D( ); // ---------------------------------------- _root.msec_text =Number(phmillis); // transfert des infos dans les variables if ( phhours<10 ){ _root.heures_text =("0"+ toString(phhours) ); }else{ _root.heures_text =(toString(phhours) ); } // -------------------------- if ( phminuts<10 ){ _root.minutes_text =( "0"+ toString(phminuts) ); }else{ _root.minutes_text =( toString(phminuts) ); } // -------------------------- if ( phsecondes<10 ){ _root.secondes_text =( "0"+ toString(phsecondes) ); }else{ _root.secondes_text =( toString(phsecondes) ); } //================================ // Aiguille des secondes v1=Number(_root.secondes_text); v2=v1*6; v3=Number(_root.msec_text); v4=v3 /( 166); _root/second._rotation =v2 +v4; //-------------------------------------------------------- // Aiguille des minutes v5=Number(_root._root.minutes_text); v6=v5*6; v7=v1/10; _root/minut._rotation =v6+v7; //--------------------------------------------------------- // Aiguille des heures v10=Number(_root.heures_text); v11=v10*30; v12=v5/2; _root.heur._rotation =v11+v12; |
Un objet avec action sur clic nommé "clic_points" i= 0; // variables des index text et points for ( j=-2; j <10; j++) { // 12 points à faire pi =3141593 / 1000000; // pour avoir PI en réel ra=100; // Rayon de position des points hangle = j *30; // position des heures rangle = hangle * pi / 180; // calcul rayon coordx = ActionCallFunction_1("Math.cos", rangle) * ra; coordy = ActionCallFunction_1("Math.sin", rangle) * ra; i=i+1; // Numéro des textes et points var2=ToString(i); v3 = ActionCallFunction_1("Math.round", coordx); v4 = ActionCallFunction_1("Math.round", coordy); //v1=ToString(v3); //v2=ToString(v4); //-------- affichage texte heure -------------------- objh="_root/sinus/h"; // chemin des lettres SetVariable("_root.h"+i+"_text",var2); SetVariable(objh+i+"._x",v3); SetVariable(objh+i+"._y",v4); //------- affichage des 12 points ----------------- obj="_root/sinus/bille"; // chemin des points SetVariable(obj+i+"._x",v3); SetVariable(obj+i+"._y",v4); } _root.coordx_text=( v3); // affichage du résultat du calcul,non utile _root.coordy_text=( v4); // affichage du résultat du calcul,non utile |
essais: