A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [CS3] Gallery minor issue AS2

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    26

    [CS3] Gallery minor issue AS2

    hi people

    got a small problem with a photo gallery im making. everything is sweet apart from this..

    have buttons for previous and next. i have a preloader in frame one. the code i used for the previous button is

    on (release, keyPress "<Left>") {
    _parent.updateFrame(-1);
    }

    now obviously its gonna minus 1 all the way back to frame one where my preloader is. how do i get it to stop at frame 2?

  2. #2
    Junior Member
    Join Date
    May 2008
    Posts
    26
    aargh this is killing me! does anyone know the answer

  3. #3
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    if the parent timelines current frame does not equal 2 go back one, else do nothing.

    on (release, keyPress "<Left>") {
    if(_parent._currentframe != 2){
    _parent.updateFrame(-1);
    }
    }

    good luck!
    Evolve Designs Interactive Media
    the natural selection

  4. #4
    Junior Member
    Join Date
    May 2008
    Posts
    26
    Hi

    Its still not working! i found some more code in the gallery which could be causing the issue. I didnt make the gallery so I dont know if you can make sense of it??? Happy to post fla if you need it. anyway here is the code

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

    updateStatus();

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

    function updateStatus () {
    _root.statusField = _root._currentFrame + " of " + _root._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 (_root._currentframe == _root._totalframes) {
    _root.gotoAndStop(1);
    } else {
    _root.nextFrame();
    }
    autoplayInit();
    }
    }
    }

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

    updateFrame();
    autoplayStatus = 0;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center