Lignes, Colonnes, et profondeur

  • multi-task
  • Born
  • Born
  • No Avatar
  • Inscription: Sep 07, 2007
  • Messages: 2
  • Status: Offline

Message Septembre 7th, 2007, 11:44 am

Je suis générer des logos dynamiques à partir d'un xml et j'ai une question de savoir pourquoi quand je charge avec le numéro 3, il chargera respectivement 3 Colum 2 rangées. Toutefois, il ne sera pas diffusée tous les articles de XML. Voici comment je suis en train de s'y prendre.
Code: [ Select ]
var numOfItems:Number;
var games:MovieClip = this;
var hspace = 10;
// ten pix space on the sides
var vspace = 10;
// ten pix space on the bottom
startCount = 1;
//counter to keep track of what step we're on
xStart = 384;
// where to start on the x axis
yStart = 300;
// where to start on the y axis
////GetEm
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
    var nodes = this.firstChild.childNodes;
    numOfItems = nodes.length;
    for (var i = 0; i<numOfItems; i++) {
        var t = games.attachMovie("iconMC", "iconMC"+i, i+1);
        t._x = xStart;
        t._y = yStart;
        t.swapDepths(0);
        // set x and y for this clip
        if (startCount != 3) {
            // find out how many we have in a row
            var xStart = Math.round(t._x+t._width+hspace);
            // only change horizontal
            startCount++;
            // add one to the count
        } else {
            // if we're on number 4 reset everything
            var xStart = 384;
            var yStart = Math.round(t._y+t._height+vspace);
            var startCount = 1;
            ////
            t.logo.logoContainer.loadMovie(nodes[i].attributes.logo);
            t.t1.tText.text = nodes[i].attributes.title;
            t.t2.cText.text = nodes[i].attributes.category;
            t.link = nodes[i].attributes.link;
            t.onRollOver = over;
            t.onRollOut = out;
            t.onRelease = released;
        }
    }
};
xml.load("icons.xml");
  1. var numOfItems:Number;
  2. var games:MovieClip = this;
  3. var hspace = 10;
  4. // ten pix space on the sides
  5. var vspace = 10;
  6. // ten pix space on the bottom
  7. startCount = 1;
  8. //counter to keep track of what step we're on
  9. xStart = 384;
  10. // where to start on the x axis
  11. yStart = 300;
  12. // where to start on the y axis
  13. ////GetEm
  14. var xml:XML = new XML();
  15. xml.ignoreWhite = true;
  16. xml.onLoad = function() {
  17.     var nodes = this.firstChild.childNodes;
  18.     numOfItems = nodes.length;
  19.     for (var i = 0; i<numOfItems; i++) {
  20.         var t = games.attachMovie("iconMC", "iconMC"+i, i+1);
  21.         t._x = xStart;
  22.         t._y = yStart;
  23.         t.swapDepths(0);
  24.         // set x and y for this clip
  25.         if (startCount != 3) {
  26.             // find out how many we have in a row
  27.             var xStart = Math.round(t._x+t._width+hspace);
  28.             // only change horizontal
  29.             startCount++;
  30.             // add one to the count
  31.         } else {
  32.             // if we're on number 4 reset everything
  33.             var xStart = 384;
  34.             var yStart = Math.round(t._y+t._height+vspace);
  35.             var startCount = 1;
  36.             ////
  37.             t.logo.logoContainer.loadMovie(nodes[i].attributes.logo);
  38.             t.t1.tText.text = nodes[i].attributes.title;
  39.             t.t2.cText.text = nodes[i].attributes.category;
  40.             t.link = nodes[i].attributes.link;
  41.             t.onRollOver = over;
  42.             t.onRollOut = out;
  43.             t.onRelease = released;
  44.         }
  45.     }
  46. };
  47. xml.load("icons.xml");


J'essaie d'obtenir 6 points montrant à partir de XML avec un bouton qui saisirait la prochaine série. Que je n'ai pas écrit encore sorti. En ce moment je suis bloqué avec obtenir seulement 6 pour voir correctement. Toutes les idées sont très appréciés. Merci d'avance
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Septembre 7th, 2007, 11:44 am

  • multi-task
  • Born
  • Born
  • No Avatar
  • Inscription: Sep 07, 2007
  • Messages: 2
  • Status: Offline

Message Septembre 7th, 2007, 11:47 am

En référence à t.swapDepths (0);

Je suis en train de manipuler de sorte qu'il est à l'origine de tout le reste de la scène. Toutefois, il est en train de mettre au-dessus de tous.

Afficher de l'information

  • Total des messages de ce sujet: 2 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 59 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