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

  FORUM HardWare.fr
  Programmation
  Flash/ActionScript

  Flash + xml

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Flash + xml

n°1038149
skynicko
Posté le 06-04-2005 à 22:01:43  profilanswer
 

Bonjour
 
J'ai crée une sorte de visionneuse en flash que je vais utiliser dans mon site web pour regarder des photos. J'ai un probleme, elle fonctionne correctement quand j'execute le fichier swf depuis mon pc. Par contre des que j'affiche le fichier swf dans ma page web il n'y a plus rien sauf les deux caracteres suivants qui s'affichent "/:"
 
Je vous donne mes sources pour avoir votre avis. Je précise que j'ai enregistré le fichier xml en utf8 avec le bloc note.
 
 
Le fichier xml

Code :
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <photos>
  3.   <photo num="1" fichier="photos/ming.jpg"  desc="Ming vous regarde" />
  4.   <photo num="2" fichier="photos/mingFlash.jpg" desc="Ming et Flash" />
  5.   <photo num="3" fichier="photos/mingOnHisKnee.jpg"  desc="Ming à genoux" />
  6.   <photo num="4" fichier="photos/people.jpg"  desc="Des gens..." />
  7.   <photo num="5" fichier="photos/fight.jpg"  desc="Combat" />
  8.   <photo num="6" fichier="photos/spacecraft.jpg"  desc="Vaisseau" />
  9. </photos>


 
Le code action script dans flash
 

Code :
  1. photos_xml = new XML();
  2. photos_xml.ignoreWhite = true;
  3. photos_xml.onLoad = function(ok) {
  4. //initialisation des variables
  5. if (ok) {
  6.  noeuds = photos_xml.firstChild.childNodes;
  7.  nbrPhotos = noeuds.length;
  8.  premierePhoto = this.firstChild.firstChild;
  9.  dernierePhoto = this.firstChild.lastChild;
  10.  enCours = premierePhoto;
  11.  affichePhoto(enCours);
  12. }
  13. };
  14. photos_xml.load("photos.xml" );
  15. function affichePhoto(photo) {
  16. loadMovie(photo.attributes.fichier, ecran);
  17. textes = photo.attributes.num + "/" + nbrPhotos + " : " + photo.attributes.desc;
  18. }
  19. suivant.onRelease = function() {
  20. if (enCours.attributes.num == nbrPhotos) {
  21.  enCours = premierePhoto;
  22. } else {
  23.  enCours = enCours.nextSibling;
  24. }
  25. affichePhoto(enCours);
  26. };
  27. precedent.onRelease = function() {
  28. if (enCours.attributes.num == 1) {
  29.  enCours = dernierePhoto;
  30. } else {
  31.  enCours = enCours.previousSibling;
  32. }
  33. affichePhoto(enCours);
  34. };


Message édité par skynicko le 06-04-2005 à 22:02:22
mood
Publicité
Posté le 06-04-2005 à 22:01:43  profilanswer
 


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

  Flash + xml

 

Sujets relatifs
lien html vers flash balèzeFlash
flash : bouton avec vers page phpprobleme avec un menu flash
lier une anim flash avec mysql via phpFlash MX 2004 : problème pour faire une action....
Flash : création d'un mini-jeux.....comment faire ?Recherche forum tout en flash
Prob avec Flash et les calquesancrage flash
Plus de sujets relatifs à : Flash + xml


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR