A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Slide show - help...

  1. #1
    Member
    Join Date
    Dec 2002
    Location
    Auckland
    Posts
    66

    Slide show - help...

    hi there,

    i am creating a slideshow which consists of 13-16 images that scroll horizontally. when the user rolls over an image the scrolling speed increases and the image moves to the middle of the viewer.

    i am close, but am getting an unacceptable result when the image moves to the middle (the image goes mental!).

    Click here to view the swf

    in brief the movie consists of the following actionscript:

    main timeline:
    ---------------------------------------------
    initSpeed = -10;
    pieces = 13;
    startLoc = 606;


    function setSpeed(speed, xStop, stopped) {
    imageSpeed = speed;
    imageXStop = xStop;
    imageStopped = stopped;
    }
    ---------------------------------------------

    scrolling mc
    ---------------------------------------------
    onClipEvent (load) {
    _root.largePieceWidth = _width/_root.pieces;
    _root.largeWidth = _width;
    _root.imageSpeed = _root.initSpeed;
    endPoint = _root.startLoc - _root.largeWidth + _root.largePieceWidth;
    }

    onClipEvent (enterFrame) {
    // first determine if mc needs to loop
    if (_x <= -15074) {
    _x = -7196;
    } else {
    if (_root.imageStopped == 1) {
    if (_x > _root.imageXStop) {
    dx = _root.imageSpeed;
    _x = _x + dx;
    } else if (_x < _root.imageXStop) {
    dx = -(_root.imageSpeed);
    _x = _x + dx;
    } else {
    _x = _root.imageXStop;
    }
    } else {
    dx = _root.imageSpeed;
    _x = _x + dx;
    }
    }
    }
    ---------------------------------------------

    each image:
    ---------------------------------------------
    on (rollOver, keyPress "<Enter>") {
    xStop = 0;
    stopped = 1;
    _root.setSpeed(-20, xStop, stopped);
    _root.mcTextVirtu.gotoandplay("startText");
    }
    on (rollOut, keyPress "<Enter>") {
    xStop = 0;
    stopped = 0;
    _root.setSpeed(_root.initSpeed, xStop, stopped);
    _root.mcTextVirtu.gotoandplay("stopText");
    }
    ---------------------------------------------

    sorry for the long post, any help would be MOST greatly appreciated.

    mike

  2. #2
    Member
    Join Date
    Dec 2002
    Location
    Auckland
    Posts
    66
    forgot to mention that when the image slides past the middle and the user rolls over it - it chages direction to get back to the middle.

    mike

  3. #3
    Senior Member
    Join Date
    Feb 2003
    Posts
    825
    seems to be working okay...

  4. #4
    Member
    Join Date
    Dec 2002
    Location
    Auckland
    Posts
    66
    works sweet if it wasn't for the mental fit when the image gets to its desired location.

    what i can see is that the image is never landing on x coordinate 0 in order to stay still??

    mike

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