# Need help with my actionscript

**URL:** <https://forum.kirupa.com/t/need-help-with-my-actionscript/259608>\
**Category:** flash\
**Created:** [May 7, 2008, 3:55am UTC](https://forum.kirupa.com/t/need-help-with-my-actionscript/259608 "2008-05-07T03:55:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKWeaponX](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@SKWeaponX](https://forum.kirupa.com/u/SKWeaponX)\
**Post date:** [May 7, 2008, 3:55am UTC](https://forum.kirupa.com/t/need-help-with-my-actionscript/259608/1 "2008-05-07T03:55:30Z")

</div>

I have two buttons one that adds 2 and one that adds 3.

```auto
score.text = 0;
add2.onPress = function():Void {
score.text = Number(score.text) + 2;
};
add3.onPress = function():Void {
score.text = Number(score.text) + 3;
};

```

I want to gotoAndPlay to another frame with the value adds to 5. Say if I press the add2 button and the add3 button, I want to go to another frame.

I tried making score.text a variable and it didn’t work.  
If (score.text =5){  
gotoAndPlay(1);  
}  
Is what I tried and nothing worked.

Any help please?
