3 Replies Latest reply on May 6, 2009 7:45 AM by kglad

    Movie Clip that calls XML not working when in another movie clip.

    gondudrik

      Hi,

      I have one movie clip (photography_container_02.fla) thats loads another movie clip (slideshow_medical_02.fla) that calls xml stuff into itself. Both work fine separately but not one withing another. I researched and found that the xml needs to be set to root, but couldnt make it work.

      Here is the action script that is in sub movie clip: (files are also attached)

       

      //----------XML--------

       

      var myXML:XML = new XML();
      myXML.ignoreWhite = true;

       

      myXML.onLoad = function() {
          trace("xml loaded");

       

          var linkname:Array = this.firstChild.childNodes;
          imageCount = linkname.length;
          trace(imageCount);

       

          var maxCount:Number = imageCount;
          var currentMC:Number = 0;
          var lastMC:Number = 0;
          var timeTrans:Number = 0.9;
          var transitionType:String = "easyInOut";

       

          _root.template_mc0.text_bg.text = myXML.firstChild.childNodes[0].attributes.desc;
          _root.template_mc0.text_bg._alpha = 100;
          var inst_events = new Object();
          Mouse.addListener(inst_events);
          left_mc.enabled = false;

       

          inst_events.onMouseDown = function() {
              for (var i:Number = 0; i<maxCount; i++) {
                  if (_root["template_mc"+i].hitArea_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
                      if (i>currentMC && i != currentMC) {
                          moveLeft();
                      } else if (i<currentMC && i != currentMC) {
                          moveRight();
                      }
                  }
              }
      };

       

      Thanks!!!