# AS3 Gurus, Can This Lose Some Weight? :)

**URL:** <https://forum.kirupa.com/t/as3-gurus-can-this-lose-some-weight/310992>\
**Category:** flash\
**Created:** [June 24, 2010, 6:11pm UTC](https://forum.kirupa.com/t/as3-gurus-can-this-lose-some-weight/310992 "2010-06-24T18:11:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![as3ohh](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@as3ohh](https://forum.kirupa.com/u/as3ohh)\
**Post date:** [June 24, 2010, 6:11pm UTC](https://forum.kirupa.com/t/as3-gurus-can-this-lose-some-weight/310992/1 "2010-06-24T18:11:24Z")

</div>

I have built a really basic way to determine what slide to show depending on an nsTime var. It works, but is way over bloated. I keep thinking of just one function to do the test, but think the whole else/if statement needs to be there for it to work.

```
 So for the most code awesome wranglers here, what would you do? (knowing I don't know classes, etc.). I would love to do something completely different like cue points but all the videos are done and I have a day to keep my job 8^(

Lastly, I am very thankful for all of the help recently. My hope is to return the favor after learning more.

```

```auto
function updateSlide()
{

    if (nsTime >= xmlData.slideTime1 && nsTime < xmlData.slideTime2)
    {
        showSlide(xmlData.slidePath1);
    }
    else if (nsTime >= xmlData.slideTime2 && nsTime < xmlData.slideTime3)
    {
        showSlide(xmlData.slidePath2);
    }
    else if (nsTime >= xmlData.slideTime3 && nsTime < xmlData.slideTime4)
    {
        showSlide(xmlData.slidePath3);
    }
    else
    {
        trace("No Slide Update Found!!! ...");
    }
}

```
