3 Replies Latest reply on Sep 29, 2006 7:42 AM by Glazer

    Need help in Actionscript

    katt77 Level 1
      I would like to put the instruction attachMovie() in this code. If some Know nows ...

      myPhoto = new XML();
      myPhoto.ignoreWhite = true;
      myPhoto.onLoad = function(success) {
      //portfolioTag = this.firstChild;
      numimages = this.firstChild.childNodes.length;
      spacing = 70;
      for (i=0; i<numimages; i++) {
      this.picHolder = this.firstChild.childNodes ;
      this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
      this.thumbHolder._x = i*spacing;
      this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
      this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
      this.thumbHolder.title = this.picHolder.attributes.title;
      this.thumbHolder.main = this.picHolder.attributes.main;
      this.thumbHolder.onRelease = function() {
      loader.loadMovie(this.main);
      title_txt.text = this.title;
      };
      }
      };
      myPhoto.load("xmlphoto.xml");
        • 1. Re: Need help in Actionscript
          kglad Adobe Community Professional & MVP
          to what do you want to attach? thumbnails["thumbnail"+i] or thumbnails["thumbnail"+i] ["thumbnail_image"]. if it's the later, just use a depth other than zero.

          p.s. this forum interprets [ i ] as encoding for italic font and that makes your code difficult to read. use the attach code option for displaying actionscript.
          • 2. Re: Need help in Actionscript
            Glazer
            With the attachMovie() method you'll need a movieclip in your library with a linkage identifier (name), so that you can reference that movieclip in the attachMovie() method call.
            It would help if you could post a snippet of the xml as a point of reference, and perhaps restructure your code so that it is a bit more manageable.
            • 3. Re: Need help in Actionscript
              Glazer Level 1
              this works, but i'm not sure about the rest of the application code you already have...