0 Replies Latest reply on Oct 30, 2006 10:05 AM by yogi bear

    loop problem

    yogi bear
      I've created a loop for 6 items on top of one another:
      function buildAddDetails() {
      var spacing:Number = 100;
      for (var i = 0; i < 6; ++i) {
      var name:String = "detail" + i + "_mc";
      _root.attachMovie("add_detail", name, i);
      _root[name]._y = i * spacing;
      }
      }
      buildAddDetails();

      When I put this inside another movie clip "detail_list" I only get the last item?

      function buildAddDetails() {
      var spacing:Number = 100;
      for (var i = 0; i < 6; ++i) {
      var name:String = "detail" + i + "_mc";
      _root.detail_list.attachMovie("add_detail", name, i);
      _root.detail_list[name]._y = i * spacing;
      _root.detail_list[name].detail_name = "Detail " + i +": " + gLastProject.proName0;

      }
      }

      buildAddDetails();

      Is this a spacing problem or a nesting problem?

      Thanks,
      YB