0 Replies Latest reply on Oct 6, 2006 6:53 AM by Tickster

    Need dynamic buttons to be scrolling

    Tickster
      I have 2 seperate sample scripts. One for scrolling menu and the other to generate dynamic buttons, both being pulled from an xml file. This is what I have so far...

      I am using Flash 8 on a Mac OSX

      http://www.telemasca.com/flash/dynamic_scrolling_buttons.swf

      As you can see, I need the buttons with numbers in them to be where the thumbnail images are... in the scrolling mc.

      This is the code I have at frame 1...
      **********************************

      myPhoto = new XML();
      myPhoto.ignoreWhite = true;
      myPhoto.onLoad = function(success) {

      numimages = this.firstChild.childNodes.length;
      spacing = 60;
      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;
      };




      this.thumbHolders = _root.attachMovie("buttonmc","button"+i,i,{_x:i*50 , _y:350});
      _root["button"+i].but_txt.text = i;
      b.id = i;

      //this.thumbLoaders.loadMovie(this.picHolder.attributes.thmb);
      this.thumbHolders.title = this.picHolder.attributes.title;
      this.thumbHolders.main = this.picHolder.attributes.main;

      this.thumbHolders.onRelease = function() {
      loader.loadMovie(this.main);
      title_txt.text = this.title;
      };
      this.thumbholders.onRollOver = function () {
      this.gotoAndStop(2);
      };
      this.thumbholders.onRollOut = function () {
      this.gotoAndStop(1);
      };
      }
      };
      myPhoto.load("xmlphoto.xml");
      *******************************************

      this is the script for the scrolling menu...
      *******************************************
      mouseX = _xmouse;
      menuX = thumbnails._x;
      menuX2 = thumbnails2._x;

      if (mouseX > 240) {
      diff = (mouseX-240)/15;
      }
      if (mouseX < 260) {
      diff = (260-mouseX)/15;
      }
      if (mouseX <= 250 && menuX <= 10) {
      setProperty("thumbnails", _x, menuX+diff);
      }
      if (mouseX >= 250 && menuX >= -300) {
      setProperty("thumbnails", _x, menuX-diff);
      }
      if (menu._x >= 56) {
      menu._x = 56;
      } else if (menu._x <= -204) {
      menu._x = -204;
      }

      gotoAndPlay(2);
      *********************************************



      The working files are here if you can help...
      http://www.telemasca.com/flash/archive.zip


      Thanks in advance