# Horizontal scrolling and math

**URL:** <https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335>\
**Category:** Uncategorized\
**Created:** [October 31, 2003, 4:34pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335 "2003-10-31T16:34:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vealchop](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vealchop](https://forum.kirupa.com/u/vealchop)\
**Post date:** [October 31, 2003, 4:34pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/1 "2003-10-31T16:34:39Z")

</div>

Hey,

I used the tutorial on this site:

[http://www.kirupa.com/developer/flash5/slidingmenu.htm](http://www.kirupa.com/developer/flash5/slidingmenu.htm)

to design an interface that scrolls horizontally when you press buttons. However, for some reason, when the mc’s scroll, things get very slow. I haven’t uploaded the site to the net yet and this only is happening when I preview. The movieclips that are scrolling are quite big compared to the tutorial (mine are about 600x600 as opposed to 100x100 as in the tutorial). My question is, is it the fact that my movieclips are so big that everything keeps slowing down, or does it have to do more with the math? I know the math calls for the movie clips to gradually stop at a designated place, if I modify the math to make it go directly to the designated spot, without using an equation to make it ease in, will that make the site run smoothly?

Thanks  
chop.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 5:30pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/2 "2003-10-31T17:30:38Z")

</div>

Have you tried increasing your framerate ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 5:44pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/3 "2003-10-31T17:44:51Z")

</div>

my framerate is at 30 fps by default

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:18pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/4 "2003-10-31T18:18:58Z")

</div>

Well, if you take out the easing, there won’t be anything smooth anymore 🙂

Anyway, it’s true that moving huge bitmaps is hard for Flash, especially if there are some \_alpha manipulations on those images. It is also true that the code of this tutorial is obsolete, and that there are ways to stop the onEnterFrame when they’re not needed…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:30pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/5 "2003-10-31T18:30:41Z")

</div>

thanks for the tips.

Is there a modification to this code that will make this run smoothly?

And I understand that if I take out the easing it won’t be “smooth”, but there is a noticeable lag of the movement (not due to the math) that is slowing everything down. I simply want it to run properly, without the stuttering. The entire movie is only 8k!

Thanks.

chop.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:33pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/6 "2003-10-31T18:33:50Z")

</div>

I’d say if you’re moving images, compress them so they don’t take much size and processor power. Also, try making them a bit smaller if you can.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:38pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/7 "2003-10-31T18:38:10Z")

</div>

I’m not sure the actual size (in kb) is important. I guess it’s the size (in pixels) that is important. Well, maybe not after all… OK you got me, Voetsjoeba, I have a doubt now :bad:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:39pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/8 "2003-10-31T18:39:22Z")

</div>

Oh, and just an idea: you could try to check which clip is visible on the screen and which clip isn’t, and set the one’s that don’t appear invisible (with \_visible=0). It might save some CPU power :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:39pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/9 "2003-10-31T18:39:25Z")

</div>

I’m attatching the file. Take a look and see what I’m doing wrong.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:47pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/10 "2003-10-31T18:47:34Z")

</div>

You have several movieclips which use masks and each movieclip has about 50 logos on them. And you have 4 of those all contained in movieclip called all which you ease using actionscript. Pretty obvious why it’s so laggy.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:51pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/11 "2003-10-31T18:51:53Z")

</div>

I just figured since the filesize was so small, that it wouldn’t matter. What would be a better way of organizing the media? Rather than using 50+ separate graphic files, should I make the arry of logos all one graphic?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 6:55pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-and-math/34335/12 "2003-10-31T18:55:38Z")

</div>

That would be a better way, yes. Instead of placing 50 logo’s on screen with a background, rather make the background with the 50 logos an image on it’s own.
