dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 37

Thread: horizontal scrolling picture gallery...... need help

  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    95

    horizontal scrolling picture gallery...... need help

    Hey,
    I hope all is well, i need to create a horzontal scrolling picture gallery, with the option to move right or left through pictures......
    Any help on how to do this would be greatly appreciated...

    Thank you
    Scythe

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Haven't checked it, but Iaskwhy just posted a .fla in this thread...

    http://www.flashkit.com/board/showth...hreadid=466970

  3. #3
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    // Scrolling Movieclip with Images inside ( images could be buttons to link to larger version).

    If thats what you are after its quite simple.

    You just have to put this code ON the movieclip you want to scroll.

    onClipEvent(enterFrame){
    this._x+=(_root.xpos-this._x)/7;
    }

    And on the buttons just set the position you want the movieclip to scroll to.

    on(release){
    xpos=356;
    }

    This will make the movieclip go to that position with a nice easing effect.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  4. #4
    Member for Life
    Join Date
    Apr 2003
    Posts
    344
    Hello ...I am using your suggestion for scrolling and I was wondering if you can answer what I am sure is a rather simple question? I have attached the .fla for you to hopefully take a look at. What I can't figure out is that when you test the movie....the mc loads at xpos=0.
    What if I want the scroll to be located say in the center of my movie and not at the far left at xpos=0? If you look at the attached .fla you see what I am referring to. I would like to know how to lace it somewhere else in the movie if I decide to.

    Thanks in advance

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Ah, this is much more elegant than mine.
    Altho mine worked with just two buttons.
    I'd like to know how the easing works in this though. I've seen easing code before, and it was pretty obvious, but this eases and I don't see anything that controls that.

    OK, I see what does it, but how.

    w00t, see, people do get smarter by the minute. The position is calculated every 40th or 12th of a second, or by whatever the frame rate is of the movie. Man, that's been bothering me for months.
    Last edited by iaskwhy; 06-28-2003 at 09:24 PM.

  6. #6
    Member for Life
    Join Date
    Apr 2003
    Posts
    344
    do you know how to make it position the mc where you want it on the swf? It laways loads at xpos=0....how can I change it to load wherever I want?

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Add a new layer for actions and in the first frame add this:

    xpos = -200;

    That will send it to box #3 when it loads.

  8. #8
    Member for Life
    Join Date
    Apr 2003
    Posts
    344
    thanks, but thats not what I am trying to do.

    If I want the mc to load pic1 at lets say (xpos=50 and ypos=200)

    How do I get the mc to load at a certain position on the swf?

    I just want to be able to load it wherever I want on the swf.

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Set the variable in the first frame of that actions layer to:

    xpos = 50;

    In effect, your resetting the left side of the stage area to x50 now instead of x0, as far as the movie is concerned. Then your button code on button 1 is:

    on(release){
    xpos=50;
    }

    Button 2 is:

    on(release){
    xpos=-50;
    }

    And so on, minus 100 after that.
    Attached Files Attached Files

  10. #10
    Member for Life
    Join Date
    Apr 2003
    Posts
    344
    ok...got it...thanks alot everyone.

  11. #11
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198

    thread shift

    my thread seems to have died on this subject, so I'm going to use this one which is more alive.

    I like the easing effect scroller, but what im looking for is a little bit different. I want to have only two buttons, one for left and one for right. When you roll over the left button, the string of images continuously scrolls until you remove the mouse from the button...whence it stops scrolling. The right button is the same, it just scrolls back to the right. Each image will then be a button to link to a larger one.

    anyone know how to do this?

    i'll try to look for an example on the web...

  12. #12
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Thats even easier.ON the different buttons.


    // left scroll
    on(rollOver){
    imageMC._x-=5;
    }

    // right scroll
    on(rollOver){
    imageMC._x+=5;
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  13. #13
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198
    but alas! I have already tried that pellepiano...

    I need something more continuous. The problem with that solution is that when you roll over, the images on move the specified amount of pixels once, hence you have to rollover again and again to get the images to move onto the screen.

    I tried to attach my fla, but for some STUPID reason, the file is 589Kb...although all it is is a blank bg with three plain fill boxes, and two arrow buttons.

  14. #14
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198
    here is my fla...i just made a new one, and its 16Kb...thats more like it!!
    Attached Files Attached Files

  15. #15
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Im sorry, got some svere brain damage toaday.

    You put this on the Movieclip......

    onClipEvent (enterFrame) {
    if (_root.left == 1) {
    this._x -= 5;
    }
    if (_root.right == 1) {
    this._x += 5;
    }
    }


    On Buttons

    // left scroll
    on(rollOver){
    left=1;
    }
    on(rollOut){
    left=0;
    }


    // right scroll
    on(rollOver){
    right=1;
    }
    on(rollOut){
    right=0;
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  16. #16
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198
    hmmm...I see where you are going with this code. I tried it out, but it doesn't seem to work. And yes, I have changed all the instance names to fit mine....
    Attached Files Attached Files

  17. #17
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Your arrows are movieclips. They need to be buttons.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  18. #18
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198
    oh, duh!!

    how silly of me not to realize that...looks like im having a brain dead day too...

    isn't there a way to do it with a movie clip too...?
    something like:

    LeftMC.onRollOver = function(){
    left=1;
    }
    LeftMC.onRollOut = function(){
    left=0;
    }

  19. #19
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198

    question pellepiano...

    what is the signifigance of this:

    originally posted by pellepiano
    onClipEvent(enterFrame){
    this._x+=(_root.xpos-this._x)/7;
    }
    i sort of understand what it does..but how would I adjust it for my own gallery so the first picture is first. Using your code, it sets like the 6th pic in the "box"

  20. #20
    foul-mouthed chucklehead
    Join Date
    Feb 2003
    Location
    inches away from you, in the 4th dimension....
    Posts
    198
    ...wait..that code above sets the easing speed, right?

    hmmm...how would I do that then??

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