FORUMS: list search recent posts

Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jay Lee
Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo
on Oct 8, 2011 at 2:53:26 pm

Hi, I'm trying to make a simple slideshow. I've used the code below which works. But I'm not sure how to make the last image go to the first. It just keeps moving into further and further white space.
----

#include "mc_tween2.as"
leftarrow.onRelease = function() {
if (pics._alpha>10) {
pics.xPos = pics._x;
pics.yPos = pics._y;
pics.slideTo(pics.xPos+516,pics.yPos,2,linear,0);
}
};

rightarrow.onRelease = function() {
if (pics._alpha>10) {
pics.xPos = pics._x;
pics.yPos = pics._y;v
pics.slideTo(pics.xPos-516,pics.yPos,2,linear,0);
}
};

----

Thank you in advance for any help!!!


Return to posts index

demetri tashie
Re: Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo
on Oct 8, 2011 at 3:24:24 pm

you will need to add to the conditional statement to check if it has reached a certain position

if the furthest you want it to travel to is x= 1000, then you might add "&& pics.xPos<1000" to the conditional statement like this:

if (pics._alpha>10 && pics.xPos<1000 ) { do something }

"&&" is the "and" operator, so now it will only execute if both the conditionas are met.
do something similar to check for the lowest value for the other button

for more information, you can read up on conditional statements and verifying for multiple conditions


Return to posts index

Jay Lee
Re: Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo
on Oct 9, 2011 at 1:11:01 am

Thank you- I will try this!!!


Return to posts index


Jay Lee
Re: Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo
on Oct 11, 2011 at 4:05:36 pm

Hi Demetrie,
I hate to ask, but is there any way that I can send you the file for your help? I've tried a few things, but I keep getting error messages and my arrows then don't work at all. I still haven't figured out how to make it loop by adding a multiple conditional statement.

Thank you for any response.


Return to posts index

demetri tashie
Re: Simple Scrolling Slideshow with Left/Right Arrow Buttons that, at Last Photo, Loops to First Photo
on Oct 12, 2011 at 2:27:15 am

sure , send the file, and i will take a look. no promises of course....


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]