1 Reply Latest reply on Jun 28, 2007 1:59 PM by MotionMaker

    Having trouble with Actionscript

    mudfrogk5
      Hello, I'm very new to flash, so new that I just started yesterday. I completed a couple tutorials and I'm trying to get the following code working for my works website. Everything looks fine to me but I'm a noob so I'm sure I'm missing something easy. Anyway on to the problem. When I click the next button it will cycle through all of the text fields correctly (all 10), however when it gets to the 5th image it defaults back to image0uri and stays there until I get back to the beginning. I need it to cycle the images correctly. I'm taking the images / text out as I don't think it's relavant but if it is then PM me and I'll send you that as well. Someone please help, and thank you in advance!!

      Scott




      /*The following four sections contain the data
      /*for each menu item.

      /* 0 */
      var image0title:String = "";
      var image0desc:String = "";
      var image0uri:String = "";
      /* 1 */
      var image1title:String = "";
      var image1desc:String = "";
      var image1uri:String = "";
      /* 2 */
      var image2title:String = "";
      var image2desc:String = "";
      var image2uri:String = "";
      /* 3 */
      var image3title:String = "";
      var image3desc:String = "";
      var image3uri:String = "";
      /* 4 */
      var image4title:String = "";
      var image4desc:String = "";
      var image4uri:String = "";
      /* 5 */
      var image5title:String = "";
      var image5desc:String = "";
      var image5uri:String = "";
      /* 6 */
      var image6title:String = "";
      var image6desc:String = "";
      var image6uri:String = "";
      /* 7 */
      var image7title:String = "";
      var image7desc:String = "";
      var image7uri:String = "";
      /* 8 */
      var image8title:String = "";
      var image8desc:String = "";
      var image8uri:String = "";
      /* 9 */
      var image9title:String = "";
      var image9desc:String = "";
      var image9uri:String = "";
      var currImage:Number = 0;
      var totalImages:Number = 10;
      menu_mc.title_txt.text = this["image"+currImage+"title"];
      menu_mc.description_txt.text = this["image"+currImage+"desc"];
      for (var i:Number = 0; i<=totalImages; i++) {
      slideShow_mc.slides_mc["holder"+i].loadMovie(this["image"+(i)+"uri"], slideShow_mc.slides_mc.getNextHighestDepth());
      }
      slideShow_mc.slides_mc["holder10"].loadMovie(this["image0uri"], slideShow_mc.slides_mc.getNextHighestDepth());
      // function for the Next button
      function nextMenuItem(eventObj:Object) {
      slideShow_mc.gotoAndPlay("slide"+(currImage));
      if ((currImage+1)>=totalImages) {
      currImage = 0;
      } else {
      currImage++;
      }
      menu_mc.title_txt.text = this._parent["image"+currImage+"title"];
      menu_mc.description_txt.text = this._parent["image"+currImage+"desc"];
      }
      // add the event listener for the button
      next_btn.addEventListener("click", nextMenuItem);