0 Replies Latest reply on Jul 12, 2007 1:31 AM by jabbberwocky10

    .this unknown in rollover function

    jabbberwocky10
      The meaning of the code is that out of een XML file I am taking a url for a picture (thumb) and place this in a movie clip. With a mouse rollover a new picture should be put over the old one (main).

      The problem is that i can't call the the movieclip in the rollover function in the same way as I did with the first picture because .this is unknown there. How can i fix this?

      Here the code:

      // Team is loaded via XML File
      myPhoto = new XML();
      myPhoto.ignoreWhite = true;
      myPhoto.onLoad = function(success) {

      numimages = this.firstChild.childNodes.length;
      spacing = 180;

      for (i=0; i<numimages; i++) {

      // The picture holder ( 1 picture)
      this.picHolder = this.firstChild.childNodes ;

      // The thumbnail holder
      this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
      this.thumbHolder._x = i * spacing; // Position the holder

      // Put info from xml in holder
      this.thumbHolder.title = this.picHolder.attributes.title;
      this.thumbHolder.main = this.picHolder.attributes.main;

      // create movieclip with image and Put the image in the thumbholder
      this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
      this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
      //this.thumbLoader.loadMovie(this.picHolder.attributes.main); <-- WORKS!

      this.thumbHolder.onRollOver = function() {
      this.thumbLoader.loadMovie(this.picHolder.attributes.main); <-- DOESN't WORK, even if I put _parent
      };

      }
      };
      myPhoto.load("team.xml");