# Vertical According is jerky

**URL:** https://forum.kirupa.com/t/vertical-according-is-jerky/267461
**Category:** flash
**Created:** [August 1, 2008, 10:57am UTC](https://forum.kirupa.com/t/vertical-according-is-jerky/267461 "2008-08-01T10:57:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marcnr](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@marcnr](https://forum.kirupa.com/u/marcnr)
#### Post date: [August 1, 2008, 10:57am UTC](https://forum.kirupa.com/t/vertical-according-is-jerky/267461/1 "2008-08-01T10:57:54Z")

</div>

I’ve created a vertical accordion based of this one - [http://www.visual-blast.com/flash/accordion-style-flash-menu/](http://www.visual-blast.com/flash/accordion-style-flash-menu/)

But for some reason in my version the scrolling is jerky and sometimes overlaps causing two layers to flash. How can i fix that. All i’ve done is change all the width values to height and all the x values to y. Heres my code.

> stop();  
> speed = 5;  
> initial\_height = 75;  
> target\_height = 300;  
> sp = rect1.\_y;  
> this.createEmptyMovieClip(“emptymc”, 0);  
> emptymc.onEnterFrame = function() {  
> for (i=1; i\<=4; i++) {  
> if (\_root.hit.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
> if (\_root[“rect”+i].hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
> new\_y = (\_root.sp-(75\*(i-1)))-rect1.\_y;  
> rect1.\_y += new\_y/speed;  
> n\_height = target\_height-\_root[“rect”+i].\_height;  
> \_root[“rect”+i].\_height += n\_height/speed;  
> } else {  
> n\_height2 = initial\_height-\_root[“rect”+i].\_height;  
> \_root[“rect”+i].\_height += n\_height2/speed;  
> }  
> } else {  
> new\_y = \_root.sp-rect1.\_y;  
> rect1.\_y += new\_y/(speed+50);  
> n\_height2 = initial\_height-\_root[“rect”+i].\_height;  
> \_root[“rect”+i].\_height += n\_height2/(speed-1);  
> }  
> \_root[“rect”+(i+1)].\_y = \_root[“rect”+i].\_y+\_root[“rect”+i].\_height;  
> \_root[“movie”+i].\_y = \_root[“rect”+i].\_y-1;  
> }  
> };
