# How to use a variable to stop action

**URL:** <https://forum.kirupa.com/t/how-to-use-a-variable-to-stop-action/150729>\
**Category:** flash\
**Created:** [June 9, 2005, 8:44pm UTC](https://forum.kirupa.com/t/how-to-use-a-variable-to-stop-action/150729 "2005-06-09T20:44:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrazyWolf](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@CrazyWolf](https://forum.kirupa.com/u/CrazyWolf)\
**Post date:** [June 9, 2005, 8:44pm UTC](https://forum.kirupa.com/t/how-to-use-a-variable-to-stop-action/150729/1 "2005-06-09T20:44:35Z")

</div>

I want the timeline to stop at a certain point if a variable is set to “off”

In the action script for the said frame I have:

```auto
if (contest == "off") {
 stop();
}

```

This does not work however. Any Ideas? Thanks
