# \[F5\] Trouble with variables

**URL:** <https://forum.kirupa.com/t/f5-trouble-with-variables/236056>\
**Category:** flash\
**Created:** [August 16, 2007, 8:01pm UTC](https://forum.kirupa.com/t/f5-trouble-with-variables/236056 "2007-08-16T20:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mugi](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mugi](https://forum.kirupa.com/u/mugi)\
**Post date:** [August 16, 2007, 8:01pm UTC](https://forum.kirupa.com/t/f5-trouble-with-variables/236056/1 "2007-08-16T20:01:11Z")

</div>

Im still fairly new to programming with actionscript, but this isn’t a largely complicated problem (I dont think so anyway).

Anyway, what I am trying to accomplish is:

-declare a variable  
-give that variable a value based on the frame number the movie is currently on  
-then add 1 to that variable

so in effect, if the movie is on frame 4 for example, the value of the variable would be 5. The code is in a button, that controls a MC that is on the stage (it doesnt interact with the \_level0 stage, just the MC its in, its for a scrolling menu)

The code Im trying to use is

var scroller = \_currentframe +1;

on(release){  
gotoAndStop(“scroller”);  
}

I know my syntax is wrong, but as I’m still new I am not totally sure what I am missing, so any hints would be grealty appreciated! Thanks!
