# Subtracting #

**URL:** <https://forum.kirupa.com/t/subtracting/12537>\
**Category:** Uncategorized\
**Created:** [February 1, 2003, 8:42am UTC](https://forum.kirupa.com/t/subtracting/12537 "2003-02-01T08:42:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cripple\_Guy](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@Cripple\_Guy](https://forum.kirupa.com/u/Cripple_Guy)\
**Post date:** [February 1, 2003, 8:42am UTC](https://forum.kirupa.com/t/subtracting/12537/1 "2003-02-01T08:42:45Z")

</div>

First of all for an example… i created an dynamic text with a variable called “BobHP”… Then when it reaches to a frame with an actionscrip which i don’t know which one to pick… so this is my problem… how do I subtract numbers from BobHP? That should be an easy question if u know how… and one more thing when you subtracting the numbers, how do you do it randomly when subracting in a specific range of 2 numbers (eg. 10 - 20, it has to be a number between those 2 numbers.)

---

<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:** [February 1, 2003, 8:44am UTC](https://forum.kirupa.com/t/subtracting/12537/2 "2003-02-01T08:44:46Z")

</div>

Well if your variable is a number you can just do…

BobHP-yourNumber

And for random numbers, read up on Kirupas great tutorial…

[http://www.kirupa.com/developer/actionscript/tricks/random.asp](http://www.kirupa.com/developer/actionscript/tricks/random.asp)
