# Auto-rotation for a slideshow through actionscript

**URL:** <https://forum.kirupa.com/t/auto-rotation-for-a-slideshow-through-actionscript/157670>\
**Category:** Uncategorized\
**Created:** [August 3, 2005, 4:18pm UTC](https://forum.kirupa.com/t/auto-rotation-for-a-slideshow-through-actionscript/157670 "2005-08-03T16:18:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellah5](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@bellah5](https://forum.kirupa.com/u/bellah5)\
**Post date:** [August 3, 2005, 4:18pm UTC](https://forum.kirupa.com/t/auto-rotation-for-a-slideshow-through-actionscript/157670/1 "2005-08-03T16:18:09Z")

</div>

I was hoping someone could help me figure out how to make a slideshow rotate with actionscript. Currently the code I have keeps it static until a button click. On pushing a button, 1 through 6, it will go to the corresponding photo in the slide. I want it to rotate thru all photos 1-6 until the user pushes any button, then the sliding will stop. Any help would REALLY be appreciated. Thanks!

This is the code I’m using:

speed =5;  
photo\_width = 380;  
slider\_width = 14

photo\_mc.onEnterFrame = function() {  
photo\_mc.\_x += (final\_x - photo\_mc.\_x)/speed;  
}  
slider.onEnterFrame = function() {  
slider.\_x += (slider\_final\_x - slider.\_x)/speed;  
}

btn01.onRelease = function() {  
final\_x =0;  
slider\_final\_x = 0;  
}

btn02.onRelease = function() {  
final\_x =-photo\_width;  
slider\_final\_x =+slider\_width;  
}

btn03.onRelease = function() {  
final\_x =-photo\_width_2;  
slider\_final\_x =+slider\_width_2;  
}

btn04.onRelease = function() {  
final\_x =-photo\_width_3;  
slider\_final\_x =+slider\_width_3;  
}

btn05.onRelease = function() {  
final\_x =-photo\_width_4;  
slider\_final\_x =+slider\_width_4;  
}

btn06.onRelease = function() {  
final\_x =-photo\_width_5;  
slider\_final\_x =+slider\_width_5;  
}
