Hi,

Simple, for your coding practices as well do this,

remove the code off of the button , give the button an instance name of "button" no quotes.

and put this under your A and B variables on the timeline;

PHP Code:
var A:Number 0;
var 
B:Number 25;

button.onRelease = function()
{
    
_root.+= 5;
    if (
_root.>= _root.B)
    {
        
_root._root.B;
    }
}; 
or if you want to do it the button method put this on the button itself and remove the if statement from the timeline
PHP Code:
on (release) {
    
_root.+= 5;
    if (
_root.>= _root.B)
    {
        
_root._root.B;
    }