|
|
|
|
Posté par
batoui, le dimanche 4 novembre 2007 à 23:07:59// Création du XML
var xml:XML = new XML();
// On ignore l'espace blanc
xml.ignoreWhite = true;
// Appel de la fonction une fois loadé
xml.onLoad = function() {
var nodes = this.firstChild.childNodes;
// Nombre d'items
numOfItems = nodes.length;
// Attachement des icons
for (var i = 0; i<numOfItems; i++) {
//--------------------------------------------------------------------
// Chargement des images dans le MC
holder.loadMovie(nodes[i].attributes.image1);
holder2.loadMovie(nodes[i].attributes.image2);
holder3.loadMovie(nodes[i].attributes.image3);
// Chargement du texte
bloctext.myText.text = nodes[i].attributes.caption;
}
};
// Chargement du fichier XML
xml.load("xml/images.xml");
onEnterFrame = function () {
loading = (_parent.holder,_parent.holder2,_parent.holder3).getBytesLoaded();
total = (_parent.holder,_parent.holder2,_parent.holder3).getBytesTotal();
percentage = Math.round((loading / total) * 100);
if (isNaN(percentage) or (percentage == 0)) {
percentage = 0;
left.half._rotation = 0;
right.half._rotation = 0;
} else if ((percentage <= 50) && (percentage > 0)) {
left.half._rotation = 0;
right.half._rotation = 3.6 * percentage;
} else if ((percentage > 50) && (percentage < 100)) {
left.half._rotation = 3.6 * (percentage - 50);
right.half._rotation = 180;
}
if ((percentage == 100) && (total > 100)) {
left.half._rotation = 180;
right.half._rotation = 180;
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
}
if ((_parent.holder,_parent.holder2,_parent.holder3)._alpha < 100) {
(_parent.holder,_parent.holder2,_parent.holder3)._alpha = (_parent.holder,_parent.holder2,_parent.holder3)._alpha + 10;
}
} else if (percentage < 100) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
}
(_parent.holder,_parent.holder2,_parent.holder3)._alpha = 0;
}
_parent.bloctext._alpha = (_parent.holder,_parent.holder2,_parent.holder3)._alpha;
percentageTxt = percentage;
};
stop();
<?xml version="1.0" encoding="utf-8"?> <IMAGES> <image image1="img/img1.jpg" image2="img/img2.jpg" image3="img/img3.jpg" caption="Découvrez nos luxeuses chambres, adaptées à vos besoins et vos budgets blablablablablabla"/> </IMAGES>
Configuration: Windows XP Firefox 2.0.0.9
Bonjour,
raw007@caramail.com Solution : Changer var nodes = this.firstChild.childNodes; par : var nodes = this.firstChild.childNodes[0]; et holder.loadMovie(nodes[i].attributes.image1); par holder.loadMovie(nodes.childNodes[i].attributes.image1); |
Bonjour,
Tout dabord merci pour la réponse :) J'ai donc essayé cette modif mais cela ne marche pas en fait maintenant il n'affiche plus rien, aucunes des images ne s'affiche, comme si le fichier .xml ne se loadé plus alors qu'auparavant tout s'affiché correctement (le preloader preloadé le mc "holder" mais pas les 2 autres) As-tu une solution pleaseee ?
|
| 15/02 09h25 | [Webmaster] Afficher une image de grande taille | Webmaster |
| 05/05 16h31 | Utiliser des accents et autres caractères spéciaux | Programmation |
| 12/01 11h17 | [BIOS] Mettre à jour (flasher) le BIOS | BIOS |
| 25/01 13h34 | [PortableFirefox] Flash, Shockwave et autres | Mozilla Firefox |
| 05/02 15h48 | Formater une carte mémoire flash | Carte mémoire |
| 06/05 23h23 | Flash+ xml - ouvrir nouvelle fenetre | 3 |
| 07/06 23h29 | Preload flash: animation swf ne démarre pas | 1 |
| 21/03 07h44 | Flash xml aleatoire | 0 |
| 02/01 17h17 | Problème Preloader flash9 dans ie | 0 |
![]() | DriveImage XML - DriveImage XML est un programme permettant de faire des images du système (partitions et lecteurs logiques) à des fins de... | Catégorie: Sauvegarde Licence: Freeware/gratuit |
![]() | Flash Player - Adobe Flash Player est un moteur d'exécution client permettant d'afficher des animations Flash dans les navigateurs Internet... | Catégorie: Web Licence: Freeware/gratuit |
![]() | Flash Movie Player - Flash Movie Player est un lecteur libre d'animations Flash ( SWF ). En plus de toutes les fonctionnalités du lecteur de... | Catégorie: Lecteurs vidéo Licence: Freeware/gratuit |
![]() | FlashGet - FlashGet est un gestionnaire de téléchargement utilisant la technologie MHT (Multi-server Hyper-threading Transportation).... | Catégorie: Téléchargement Licence: Freeware/gratuit |
![]() | Technaxx M-Flash 4 | Catégorie: Lecteur MP3 | 34.99 € Matrixx-media FR |
![]() | Technaxx M-Flash 2 | Catégorie: Lecteur MP3 | 26.99 € Matrixx-media FR |
![]() | Maxfield G-Flash Summer Edition | Catégorie: Lecteur MP3 | |
![]() | Maxfield G-Flash Pro Deluxe | Catégorie: Lecteur MP3 |