5 Replies Latest reply on Nov 6, 2008 10:08 AM by kglad

    load dyn mc from library

    Sarah.....
      i have an xml img slideshow playing inside 9 movie clips. when someone presses a navigation mc, i would like a linked movie clip from my library to show up replacing the img slideshow image with the movie clip. currently, when i click on the navigation mc the img slideshow does stop and the movie clips they are loaded into go white but the movie clip in the library will not show up. I have the mc in my library Export First Frame, Export Action Script and the identifier name is "videoPage".

      here is the code (the very last function is the one where I am trying to code replacing the images with the library movie clip): - by the way, thanks for the help!

      var photo:Boolean = true;
      var nav:Boolean = false;
      var curImage:Number = 0;

      var img_xml = new XML()
      img_xml.ignoreWhite = true;
      img_xml.load("images.xml");
      var imgArray = new Array();

      img_xml.onLoad = function()
      {var slideTimer:Number = Number(img_xml.firstChild.firstChild.attributes.time);
      for (i = 1; i < img_xml.firstChild.childNodes.length; i++){
      imgArray[i - 1] = img_xml.firstChild.childNodes .attributes.path;}
      setInterval(nextImage, slideTimer);
      }

      function nextImage() {
      curImage++
      if (curImage == imgArray.length) {
      curImage = 0;
      }else if (nav == false) {
      // do nothing;
      }
      load_photo_mc();
      }

      /////////////// load image slideshow //////////////

      function load_photo_mc() {
      if (photo == true & nav == false) {
      photo = !photo;
      for (var n = 1; n < 10; n++) {
      this["pol" + n].photo_mc.loadMovie(imgArray[curImage]);}
      }else if (photo == false & nav == false) {
      photo = !photo;
      for (var n = 1; n < 10; n++) {
      this["pol" + n].photo_mc2.loadMovie(imgArray[curImage]);}
      }else{
      }
      }

      /////////////// load navigation pages //////////////
      // this is what i can not get to work..../////

      this.videoNav.onPress = function() {
      nav = true;
      for (var n = 1; n < 10; n++) {
      this["pol" + n].photo_mc2.attachMovie(videoPage);
      this["pol" + n].photo_mc1.attachMovie(videoPage);}
      }