Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2706 connectés 

  FORUM HardWare.fr
  Programmation
  Flash/ActionScript

  reprendre avec MovieClipLoader

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

reprendre avec MovieClipLoader

n°1335183
olimann
Posté le 30-03-2006 à 00:17:50  profilanswer
 

:) Salut !!
 
J’aimerais reprendre ce code et le mettre à jour (je débute un peu )
J’aimerais savoir ce qui devient inutile dans ce code  si j’utilise un  "MovieClipLoader"
 
Merci !!

Code :
  1. var Nbr;
  2. var curLength;
  3. function galleryChoice(q) {
  4. pArray = new Array();
  5. tArray = new Array();
  6. iArray = new Array();
  7. my_xml = new XML();
  8. for (var j = 0; j<curLength; j++) {
  9.  this["thmb"+j].removeMovieClip();
  10. }
  11. my_xml.ignoreWhite = true;
  12. my_xml.onLoad = function(loaded) {
  13.  if (loaded) {
  14.   gallery = this.firstChild.childNodes[q];
  15.   curLength = gallery.childNodes.length;
  16.   for (var i = 0; i<gallery.childNodes.length; i++) {
  17.    pArray.push(gallery.childNodes[i].attributes.source);
  18.    tArray.push(gallery.childNodes[i].attributes.thumb);
  19.    iArray.push(gallery.childNodes[i].attributes.title);
  20.   }
  21.  }
  22.  delay = setInterval(makeButtons, 50);
  23. };
  24. my_xml.load("gallery.xml" );
  25. }
  26. //*********************************************************************
  27. function makeButtons() {
  28. Nbr = 0;
  29. clearInterval(delay);
  30. for (var i = 0; i<tArray.length; i++) {
  31.  var Mc_clip = thmb.duplicateMovieClip("thmb"+i, 1000+i);
  32.  Mc_clip.id = i;
  33.  Mc_clip._x = i%3*50;
  34.  Mc_clip._y = Math.floor(i/3)*50;
  35. }
  36. loadButtons();
  37. }
  38. //*********************************************************************
  39. function loadButtons() {
  40. var tbox = this["thmb"+Nbr].box;
  41. tbox.loadMovie(tArray[Nbr]);
  42. temp = this.createEmptyMovieClip("tmp"+Nbr, 999);
  43. temp.onEnterFrame = function() {
  44.  bt = tbox.getBytesTotal();
  45.  bl = tbox.getBytesLoaded();
  46.  if (bt == bl && bt>4) {
  47.   nextButton();
  48.   delete this.onEnterFrame;
  49.  }
  50. };
  51. }
  52. //*********************************************************************
  53. function nextButton() {
  54. if (Nbr<tArray.length-1) {
  55.  Nbr++;
  56.  loadButtons();
  57. } else {
  58.  activateButtons();
  59. }
  60. }
  61. //tous les boutons*********************************************************************
  62. function activateButtons() {
  63. mainButtons();
  64. for (var i = 0; i<pArray.length; i++) {
  65.  var but = this["thmb"+i];
  66.  but.id = i;
  67.  but.onRelease = function() {
  68.  };
  69. }
  70. }
  71. //*********************************************************************
  72. butArray = new Array();
  73. butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn"];
  74. function mainButtons() {
  75. for (var i = 0; i<butArray.length; i++) {
  76.  this[butArray[i]].id = i;
  77.  this[butArray[i]].onRelease = function() {
  78.   galleryChoice(this.id);
  79.  };
  80. }
  81. }
  82. //*********************************************************************
  83. galleryChoice(0);


mood
Publicité
Posté le 30-03-2006 à 00:17:50  profilanswer
 

n°1335239
mechkurt
Posté le 30-03-2006 à 08:09:41  profilanswer
 

[:sh@rdar]  

Citation :


var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("YourImage.jpg", container);


source:http://livedocs.macromedia.com/flash/8_fr/main/00002541.html
en gros:
tbox.loadMovie(tArray[Nbr]); == mcLoader.loadMovie(tArray[Nbr], tbox);


---------------
D3

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Flash/ActionScript

  reprendre avec MovieClipLoader

 

Sujets relatifs
PB avec la classe MovieClipLoaderReprendre le php
[php]Lire un fichier et reprendre les donnéesAttendre un instant avant de reprendre
Reprendre un classreprendre une variable php dans une autre page
Lancer un prog puis reprendre la main après exécution de ce dernier[Excel] Coment reprendre la valeur d'1 cellule... ?
Qui veut reprendre ce projet ?Peut-on reprendre les javascripts du forum?
Plus de sujets relatifs à : reprendre avec MovieClipLoader


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)