# How to set delay to variable

**URL:** https://www.finalbuilder.com/forums/t/how-to-set-delay-to-variable/1422
**Category:** Discussion
**Created:** [January 9, 2010, 7:06am UTC](https://www.finalbuilder.com/forums/t/how-to-set-delay-to-variable/1422 "2010-01-09T07:06:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pkellner](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/pkellner/32/94_2.png) [@pkellner](https://www.finalbuilder.com/forums/u/pkellner)
#### Post date: [January 9, 2010, 7:06am UTC](https://www.finalbuilder.com/forums/t/how-to-set-delay-to-variable/1422/1 "2010-01-09T07:06:41Z")

</div>

The Delay action does not seem to let me put a %delayseconds% type variable in the counter fields for setting.&nbsp; I want to set the delay to x number of minutes based on some variable.&nbsp; How can I do that?

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [January 10, 2010, 10:17am UTC](https://www.finalbuilder.com/forums/t/how-to-set-delay-to-variable/1422/2 "2010-01-10T10:17:06Z")

</div>

Hi Peter,   
  
 Unfortunately this is one of the limitations of using the numeric up/down control, to work around it just set the value in the action’s BeforeAction script event, so for example:   
  
 [Javascript]   
 Action.Delay = Delay\_Variable;   
  
 Where “Delay\_Variable” is the name of the variable containing the number of milliseconds that the delay should be set to.   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![pkellner](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/pkellner/32/94_2.png) [@pkellner](https://www.finalbuilder.com/forums/u/pkellner)
#### Post date: [January 19, 2010, 3:58am UTC](https://www.finalbuilder.com/forums/t/how-to-set-delay-to-variable/1422/3 "2010-01-19T03:58:55Z")

</div>

Thanks, I think I just wrote my longest blog post on the simplest thing to do, but I bet it will help others. Though incredibly simple, sometimes it's not as obvious as you might think:   
  
&nbsp;

[peterkellner.net/2010/01/19/finalbu...ipt-delay/](http://peterkellner.net/2010/01/19/finalbuilder-action-scripting-javascript-delay/)
