0 Replies Latest reply on Jun 21, 2007 4:43 PM by Iron_Mike

    Problem with AS 2 code...

    Iron_Mike
      Hi,

      I bought this template because I wanna use certain stuff from it for my page.

      Unfortunately I'm not that experienced with Action Script, so here we go... (btw, it's AS 2.0)

      I ripped out a portion of the template which is like a photo gallery, but only the small preview thumbnails.

      Now, I have a lot of preview thumbnails, but because of limitations to the size of the page I can only show a few at once - let' say 8 - and then have arrow keys on the top and the bottom to go show the next / previous 8 thumbnails.

      In the template that I bought the code, of course, works, but when I ripped it out it doesn't really work anymore, probably something is missing or has to be adjusted...

      Here's the code that is applied to the preview thumbnails:

      onClipEvent (load) {
      accel =0;
      rate = 0.05;
      trace(_y)
      _root.ykoord=20.5;
      }

      onClipEvent(enterFrame) {
      y=y*accel+(_root.ykoord-_y) * rate;
      _y+=y;
      if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

      }


      Here's the code that is applied to one of the arrow buttons:

      on (rollOver) {
      gotoAndPlay("S1");
      }
      on (releaseOutside, rollOut) {
      gotoAndPlay("S2");
      }
      on (release) {
      if (_root.ykoord>-200) {
      _root.ykoord -= 308;
      }
      }

      The rollover effect for the button is working, just when u click on them nothing is moving / transitioning.

      Like I said, in the original template the code is working.

      Because of my very limited action script skills ;) I just understand half of the code that's why I can't seem to adjust it...

      I managed to write my own very simple code to make the buttons move the preview thumbnails, something like:

      on (release) {
      _root.small_pics_all.small_pics._y = _root.small_pics_all.small_pics._y - 308;
      }

      but it just does not have the nice transition scrolling that the other one has...

      Any help is very, very appreciated ! ;)

      Mike