1 Reply Latest reply on Jul 6, 2009 2:43 PM by kglad

    Flash Gallery Template not working as expected

    zebo3k

      I am very new to Flash and barely know ActionScript. I have created a flash gallery using the in built template in Flash8, which works fine. The gallery forms part of my gallery page of a separate SWF flash site. I load the gallery using a loder component. Since the gallery navigation works by targeting the root folder, my site gets screwed up. The question is, how do i modify the ActionScript in the gallery.fla file (flash inbuilt template), so that once loaded into the main site, it doesnt target the root timeline, but targets its own timeline i.e. the gallery's own timeline. I hope i'm making sense?

       

      Please see below for the code in the Flash Gallery. PS: I didnt write the code - its inbuilt into the template:

       

      function updateFrame (inc) {
      // send slides to new frame
      newFrame = _level1._currentFrame + inc;
      _level1.gotoAndStop(newFrame);

      updateStatus();

      if (_level1._currentFrame == 1) {
        prevBtn.gotoAndStop(2);
      } else {
        prevBtn.gotoAndStop(1);
      }
      if (_level1._currentFrame == _level1._totalFrames) {
        nextBtn.gotoAndStop(2);
      } else {
        nextBtn.gotoAndStop(1);
      }
      }

      function updateStatus () {
      _level1.statusField = _level1._currentFrame + " of " + _level1._totalFrames;
      }

      function autoplayInit () {
      startTime = getTimer();
      hideControls();
      updateStatus();
      }

      function autoplay () {
      if (autoplayStatus != 0) {
        // get the current time and elapsed time
        curTime = getTimer();
        elapsedTime = curTime-startTime;

        // update timer indicator
        indicatorFrame = int(4/(delay/(elapsedTime/1000)));
        indicator.gotoAndStop(indicatorFrame+1);

        // if delay time if met, goto next photo
        if (elapsedTime >= (delay*1000)) {
         if (_level1._currentframe == _level1._totalframes) {
          _level1.gotoAndStop(1);
         } else {
          _level1.nextFrame();
         }
         autoplayInit();
        }
      }
      }

      function hideControls () {
      nextBtn.gotoAndStop(2);
      prevBtn.gotoAndStop(2);
      }

      updateFrame();
      autoplayStatus = 0;