IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

probleme taille image fichier xml


Sujet :

Flash

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 8
    Points : 2
    Points
    2
    Par défaut probleme taille image fichier xml
    Bonjour,
    Je suis en train de creer un slideshow en flash à partir d'un fichier xml et j'ai un probleme avec le redimensionnement de mes images.
    Voici le code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    57
    58
    59
    60
    slides_xml = new XML();
    slides_xml.onLoad = startSlideShow;
    slides_xml.load("slides.xml");
    slides_xml.ignoreWhite = true;
    var w = 15;
    var h = 20;
     
     
    //
    // Show the first slide and intialize variables
    function startSlideShow(success) {
    	if (success == true) {
    			rootNode = slides_xml.firstChild;
    			s1 = rootNode.firstChild;
    			s = s1;
    			s2 = s1.nextSibling;
    			s3 = s2.nextSibling;
    			s4 = s3.nextSibling;
    			s5 = s4.nextSibling;
    			s6 = s5.nextSibling;
    			updateSlide(s,s1,s2,s3,s4,s5,s6);
    			//cadre1(s2);
    	}
    }
    function updateSlide(s,s01,s02,s03,s04,s05,s06) {
    		imagePath = s.attributes.jpegURL;
    		Path1 = s01.attributes.jpegURL;
    		Path2 = s02.attributes.jpegURL;
    		Path3 = s03.attributes.jpegURL;
    		Path4 = s04.attributes.jpegURL;
    		Path5 = s05.attributes.jpegURL;
    		Path6 = s06.attributes.jpegURL;
    		this.targetClip._width=80;
    		this.targetClip._height=100;
    		this.c1._width=w;
    		this.c1._height=h;
    		this.c2._width=w;
    		this.c2._height=h;
    		this.c3._width=w;
    		this.c3._height=h;
    		this.c4._width=w;
    		this.c4._height=h;
    		this.c5._width=w;
    		this.c5._height=h;
    		this.c6._width=w;
    		this.c6._height=h;
    		loadMovie(imagePath,this.targetClip);	
    		loadMovie(Path1,this.c1);	
    		loadMovie(Path2,this.c2);	
    		loadMovie(Path3,this.c3);	
    		loadMovie(Path4,this.c4);	
    		loadMovie(Path5,this.c5);	
    		loadMovie(Path6,this.c6);	
    }
     
     
    this.but.onRelease = function() {
    	s = s.nextSibling;
    	updateSlide(s,s1,s2,s3,s4,s5,s6);
    };
    L'initialisation donne ceci:


    Lorsque j'appuie sur le bouton voici ce que j'obtiens:


    Je ne comprends pas pourquoi les images changent de dimensions.
    Merci pour votre aide.

  2. #2
    Membre émérite
    Avatar de jean philippe
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 062
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 062
    Points : 2 313
    Points
    2 313
    Par défaut
    salut
    c'est pas du à ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    this.targetClip._width=80;
    		this.targetClip._height=100;
    ??

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 8
    Points : 2
    Points
    2
    Par défaut
    Je ne pense pas...
    En tout cas je viens de créer une autre fonction comme updateSlides mais sans les lignes ou je change la taille et plus de problemes.
    Je ne comprends pas pourquoi mais bon ca marche.

    J'aimerais remplacer ce bout de code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    this.but.onRelease = function() {
    	s = s.nextSibling;
    	update(s,s1,s2,s3,s4,s5,s6);
    };
    et mettre des listener sur chaque diapo, mais cela ne marche que pour les boutons et pas les clips... une idée?
    merci

  4. #4
    Membre émérite
    Avatar de jean philippe
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 062
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 062
    Points : 2 313
    Points
    2 313
    Par défaut
    il te faut creer une boucle avec : for

  5. #5
    Candidat au Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 8
    Points : 2
    Points
    2
    Par défaut
    En fait mon probleme c'est juste que la fonction onRelease marche sur un bouton mais pas sur un clip...

  6. #6
    Membre émérite
    Avatar de jean philippe
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 062
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 062
    Points : 2 313
    Points
    2 313
    Par défaut
    Citation Envoyé par kichon
    En fait mon probleme c'est juste que la fonction onRelease marche sur un bouton mais pas sur un clip...
    ??????
    onRelease fonctionne aussi bien sur un bouton que sur un clip

Discussions similaires

  1. Réponses: 2
    Dernier message: 13/08/2007, 19h45
  2. [XML][XSLT]taille de fichier xml et transformation
    Par guil1 dans le forum XSL/XSLT/XPATH
    Réponses: 4
    Dernier message: 24/11/2006, 19h15
  3. Probleme avec les fichiers XML
    Par fle7a dans le forum XML/XSL et SOAP
    Réponses: 1
    Dernier message: 17/07/2006, 10h32
  4. [xml][asp_vbscript] Taille de fichier XML trop grande...
    Par nicko5959 dans le forum XML/XSL et SOAP
    Réponses: 1
    Dernier message: 06/03/2006, 11h50
  5. TSearchRec probleme taille du fichier
    Par beastman007 dans le forum Langage
    Réponses: 8
    Dernier message: 24/05/2005, 16h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo