How to count to 8 and then start over


my problem can't seem reset countreg var 0 once hits 8. ideas?

 

 

var countreg:number = 0;

 

 

function nextreg(event:mouseevent) : void

{

             if (countreg == 9)

          {

                    (countreg == 0);

           }

          countreg++;

 

          trace (countreg)  // keeps counting up. won't start on after 8

 

}

 

 

this.next1_btn.addeventlistener (mouseevent.click, nextreg);

 

 

thanks much

function nextreg(event:mouseevent) : void

{

countreg=(countreg+1)%9

 

}



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

PProHeadless.exe has stopped working error when opening projects in Adobe Media Encoder CS6

Preconditions Failed. - Joomla! Forum - community, help and support