1 Reply Latest reply on Apr 19, 2006 11:38 AM by shyaway

    Creating Dynamic content using a loop

    awaller23
      I am not sure if I am stating this correctly but here goes:

      I am creating a training interface which will have a list of categories on the left which needs the option to grow when a user decides to add new categories to the list. This interface will function much like the macromedia on demand training section:

      http://www.macromedia.com/macromedi...l?id=245&type=2

      Here is a sample of the code that I have so far. I have all of the images and text reading from an external xml file.

      // define our variables
      var oXML;
      var tNodes;
      var xmlPath = "xml/categories.xml"; //

      // define our xml object and load up the naughty word file
      menuXml = new XML();
      menuXml.ignoreWhite = true;
      menuXml.onLoad = function() {
      menuItem = this.firstChild.childNodes;
      for (var i=0; i<menuItem.length; i++) {

      item._x = 0;
      item._y = 20*i;
      item.itemLabel.text = menuItem .attributes.name;
      item.myUrl = menuItem
      .attributes.url;
      blueBar1.onPress = function() {

      blankMC1.attachMovie("blueBar", "blueBar1" + i, i);
      // THIS IS THE LINE OF TEXT THAT WILL NEED TO BE CHANGED "loadMovie("scroll1.swf", "blankTraining1");" SIMPLY CHANGE THE NAME OF THE .swf FILE TO THE FILE THAT YOU WOULD LIKE TO HAVE PLAY
      loadMovie("scroll1.swf", "blankTraining1");
      }
      blueBar2.onPress = function() {
      blankMC2.attachMovie("blueBar", "blueBar2" + i, i);
      // THIS IS THE LINE OF TEXT THAT WILL NEED TO BE CHANGED "loadMovie("scroll2.swf", "blankTraining2");" SIMPLY CHANGE THE NAME OF THE .swf FILE TO THE FILE THAT YOU WOULD LIKE TO HAVE PLAY
      loadMovie("scroll2.swf", "blankTraining2");
      }
      etc.

      Thanks