# Adding numbers to a total

**URL:** https://forum.kirupa.com/t/adding-numbers-to-a-total/283296
**Category:** flash
**Created:** [March 4, 2009, 4:07pm UTC](https://forum.kirupa.com/t/adding-numbers-to-a-total/283296 "2009-03-04T16:07:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![annonse](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@annonse](https://forum.kirupa.com/u/annonse)
#### Post date: [March 4, 2009, 4:07pm UTC](https://forum.kirupa.com/t/adding-numbers-to-a-total/283296/1 "2009-03-04T16:07:33Z")

</div>

Hello Kirupa!  
For a long time I’ve used the free tutorials on this website; thanks alot for sharing top notch tuts to us deadly! 🙂

Disclaimer: I’m a total newbie when it comes to the actionscript-skills needed to solve the following problem, so please, however easy it might be - do not flame me 😃

Now to my problem:  
Say I have 4 values (level\_reached1, level\_reached2, level\_reached3, level\_reached4) I want to add up to a total, and another 4 values (goal1, goal2, goal3, goal4) I want to add up to a total. How do I add these up and compare them to each other, and if the “level\_reached” is equal to OR greater than “goal” I want a movie to gotoAndStop(2);

Here is what I have, which does not work, I probably have things really mixed up:

```auto

leveltotal = level1 + level2 + level3 + level4;
goaltotal = goal1 + goal2 + goal3 + goal4;

if (leveltotal >= goaltotal) {
    myMovieClip.gotoAndStop(2);
}

```

In advance, thanks 🙂
