1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| x=1
if (x)
{
_root.document=new XML(); //création de l'objet XML
_root.document.ignoreWhite=true;// les espaces vides sont supprimés
_root.document.load("adresse_fichier_xml.xml");//chargement du document XML
//_root.stop();
_root.document.onLoad=function(){ //quand le chargement du document est terminé , lancement de l'animation
titre=document.firstChild.childNodes[x].attributes.id_nom_produit
prix=document.firstChild.childNodes[x].attributes.id_prix+" "
_level0.titre=titre+" "+prix
description=document.firstChild.childNodes[x].attributes.id_description
longueur=length(description)
if(longueur>50)
{
description=description.substring(0,50)+" ..."
}
_level0.description=description
date_depart=document.firstChild.childNodes[x].attributes.id_date_depart
//decoupage des dates
tableau_date_depart=date_depart.split("/")
date_depart=tableau_date_depart[0]+"/"+tableau_date_depart[1]
date_retour=document.firstChild.childNodes[x].attributes.id_date_retour
tableau_date_retour=date_retour.split("/")
date_retour=tableau_date_retour[0]+"/"+tableau_date_retour[1]
_level0.ma_date="Du "+date_depart+" au "+date_retour
adresse_image=document.firstChild.childNodes[x].attributes.id_url_img
adresse_image2=document.firstChild.childNodes[x].attributes.id_url_img_2
adresse_image3=document.firstChild.childNodes[x].attributes.id_url_img_3
_root.createEmptyMovieClip("photo1",0);
photo1.loadMovie(adresse_image);
photo1._x=7.5
photo1._y=187,9
photo1._width=30
photo1._height=20
_root.createEmptyMovieClip("phot2",0);
photo2.loadMovie(adresse_image2);
photo2._x=112,1
photo2._y=187,9
photo2._width=20
photo2._height=20
_root.createEmptyMovieClip("photo3",0);
photo3.loadMovie(adresse_image3);
photo3._x=216,1
photo3._y=187,9
photo3._width=20
photo3._height=20
_root.play();
}
stop();
} |
Partager