# Stopping setInterval

**URL:** <https://forum.kirupa.com/t/stopping-setinterval/177915>\
**Category:** flash\
**Created:** [February 6, 2006, 2:50pm UTC](https://forum.kirupa.com/t/stopping-setinterval/177915 "2006-02-06T14:50:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saveth](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@saveth](https://forum.kirupa.com/u/saveth)\
**Post date:** [February 6, 2006, 2:50pm UTC](https://forum.kirupa.com/t/stopping-setinterval/177915/1 "2006-02-06T14:50:57Z")

</div>

I currently have a switch case setup to detect which action to do

```auto

// =========================================================================
// Action Switch Case
// =========================================================================
switch (iAction) {
    case "1":
        setInterval(tweenInImage, 3000);
        break ;
    case "2":
        break ;
    case "3":
        break ;
    case "4":
        break ;
    case "5":
        break ;
    default:
        trace ("Action Not Defined") ;
}

```

my problem is that the code repeats itself instead of stopping after running the function one.

```auto

function tweenInImage() {
    easeType = mx.transitions.easing.Strong.easeOut;
    var begin:Number = 768;
    var end:Number = 75;
    var time:Number = 1;
    var mc:MovieClip = image_mc;
    imageInTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time, true);
};

```

How would I stop the setInterval from running repeatedly?

Thanks,  
Saveth
