Actionscript 2.0 et XML

  • TheMexican
  • Born
  • Born
  • No Avatar
  • Inscription: Avr 29, 2008
  • Messages: 3
  • Status: Offline

Message Mai 24th, 2008, 4:13 pm

Bonjour et Merci de lire ceci.

J'ai donc ce document XML pour un aperçu de défilement, j'ai créé en flash. Voici le site:
http://www.roy-trainer.com/HelenNewman/ ... wman2.html

Déplacez votre souris vers le bas du site. Le panneau du bas permettant de connaître le diapositives miniatures. Lorsque vous cliquez sur une miniature d'une photo agrandie apparaît avec des informations sur le produit vers la droite.

Maintenant, chaque produit a son propre site web. Est-il possible que je peux créer un lien URL dans XML qui sera affiché sur le site?

Code: [ Select ]
<?xml version="1.0" encoding="utf-8"?>
<photos>
<image photo="Curawear">
<caption>HERE LIES THE COPY FOR CURA WEAR.</caption>
</image>
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <photos>
  3. <image photo="Curawear">
  4. <caption>HERE LIES THE COPY FOR CURA WEAR.</caption>
  5. </image>


Here is the website: http://www.curawear.com/

Et à l'usure puis-je le place dans ce AS:
Code: [ Select ]
/**********import classes**********/
import mx.transitions.*;
import mx.transitions.easing.*;
/**********declare variables and instances**********/
var nextX = -440;
/**********create objects**********/
var xmlPhotos:XML = new XML();
var initThumb:Object = new Object();
/**********handle events**********/
xmlPhotos.onLoad = function() {
    for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
        initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
        initThumb.desc = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
        makeAThumb(i);
        nextX += 100;
    }
    setInterval(_root,"scroller",50);
};
initThumb.onRollOver = function() {
    var moveX = this._x-10;
    thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 120, .5, true);
    thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
    thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 120, .5, true);
};

initThumb.onRollOut = function() {
    var moveX = this._x+10;
    thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, .5, true);
    thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
    thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, .5, true);
};
initThumb.onRelease = function() {
    txtTitle.text = this.photo;
    txtDesc.text = this.desc;
    mcLargePhoto.loadMovie("images/large/"+this.photo+".png");
};
/**********functions**********/
function makeAThumb(num) {
    var thumbName:String = "mcThumb"+num;
    panelBottom.mcScroller.attachMovie("thumb",thumbName,num,initThumb);
    panelBottom.mcScroller[thumbName].mcPhoto.loadMovie("images/thumbs/"+panelBottom.mcScroller[thumbName].photo+".png");
    panelBottom.mcScroller[thumbName]._x = nextX;
    panelBottom.mcScroller[thumbName]._y = 0;
    panelBottom.mcScroller[thumbName]._xscale = 100;
    panelBottom.mcScroller[thumbName]._yscale = 100;
}
function scroller() {
    //if (this._ymouse>mcScroller._y) {
    var scrollSpeed = (this._xmouse-Stage.width/2)/15;
    if (Math.abs(scrollSpeed)<1) {
        scrollSpeed = 0;
    }
    panelBottom.mcScroller._x -= scrollSpeed;
    if (panelBottom.mcScroller._x>0) {
        panelBottom.mcScroller._x = 0;
    } else if (panelBottom.mcScroller._x<Stage.width-panelBottom.mcScroller._width) {
        panelBottom.mcScroller._x = Stage.width-panelBottom.mcScroller._width;
    }
    updateAfterEvent();
}
/**********set properties**********/
xmlPhotos.ignoreWhite = true;
/**********run now**********/
xmlPhotos.load("photos.xml");
panelBottom.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
panelBottom.mcScroller._x = 0;
panelBottom.mcScroller._y = -78;
  1. /**********import classes**********/
  2. import mx.transitions.*;
  3. import mx.transitions.easing.*;
  4. /**********declare variables and instances**********/
  5. var nextX = -440;
  6. /**********create objects**********/
  7. var xmlPhotos:XML = new XML();
  8. var initThumb:Object = new Object();
  9. /**********handle events**********/
  10. xmlPhotos.onLoad = function() {
  11.     for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
  12.         initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
  13.         initThumb.desc = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
  14.         makeAThumb(i);
  15.         nextX += 100;
  16.     }
  17.     setInterval(_root,"scroller",50);
  18. };
  19. initThumb.onRollOver = function() {
  20.     var moveX = this._x-10;
  21.     thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 120, .5, true);
  22.     thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
  23.     thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 120, .5, true);
  24. };
  25. initThumb.onRollOut = function() {
  26.     var moveX = this._x+10;
  27.     thumbScaleX = new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, .5, true);
  28.     thumbPositionX = new Tween(this, "_x", Bounce.easeOut, this._x, moveX, .5, true);
  29.     thumbScaleY = new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, .5, true);
  30. };
  31. initThumb.onRelease = function() {
  32.     txtTitle.text = this.photo;
  33.     txtDesc.text = this.desc;
  34.     mcLargePhoto.loadMovie("images/large/"+this.photo+".png");
  35. };
  36. /**********functions**********/
  37. function makeAThumb(num) {
  38.     var thumbName:String = "mcThumb"+num;
  39.     panelBottom.mcScroller.attachMovie("thumb",thumbName,num,initThumb);
  40.     panelBottom.mcScroller[thumbName].mcPhoto.loadMovie("images/thumbs/"+panelBottom.mcScroller[thumbName].photo+".png");
  41.     panelBottom.mcScroller[thumbName]._x = nextX;
  42.     panelBottom.mcScroller[thumbName]._y = 0;
  43.     panelBottom.mcScroller[thumbName]._xscale = 100;
  44.     panelBottom.mcScroller[thumbName]._yscale = 100;
  45. }
  46. function scroller() {
  47.     //if (this._ymouse>mcScroller._y) {
  48.     var scrollSpeed = (this._xmouse-Stage.width/2)/15;
  49.     if (Math.abs(scrollSpeed)<1) {
  50.         scrollSpeed = 0;
  51.     }
  52.     panelBottom.mcScroller._x -= scrollSpeed;
  53.     if (panelBottom.mcScroller._x>0) {
  54.         panelBottom.mcScroller._x = 0;
  55.     } else if (panelBottom.mcScroller._x<Stage.width-panelBottom.mcScroller._width) {
  56.         panelBottom.mcScroller._x = Stage.width-panelBottom.mcScroller._width;
  57.     }
  58.     updateAfterEvent();
  59. }
  60. /**********set properties**********/
  61. xmlPhotos.ignoreWhite = true;
  62. /**********run now**********/
  63. xmlPhotos.load("photos.xml");
  64. panelBottom.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
  65. panelBottom.mcScroller._x = 0;
  66. panelBottom.mcScroller._y = -78;
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Mai 24th, 2008, 4:13 pm

Afficher de l'information

  • Total des messages de ce sujet: 1 message
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 35 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC