Problem with led sequence whithout delay()

I am having a issue with a program involving leds and a button. The objective is to make the 8 leds turn on and off in sequence with a second in between. And then when i press the button the sequence have to change direction. But that need to happen immediately. In this case i cant use the delay () function.

I wrote the code the best i could but its not working. Can you guys help me out a bit since i am a noob at this.

int val =0;
int buttonPin = 13;
int valor;
long previusMillis = 0;
int ledState;
long interval = 1000;
long currentMillis = millis();
void setup() {

for (int valor = 2; valor < 9; valor++) {
pinMode(valor, OUTPUT);
}
pinMode(buttonPin, INPUT);

}

void loop() {

if (currentMillis - previusMillis > interval){
previusMillis = currentMillis;

if(ledState == LOW){
ledState == HIGH;
}
else{
ledState == LOW;
}

val = digitalRead(buttonPin);

if (val == HIGH) {
if (valor <=2){
valor =10;
}else{
valor--;
}
}
else if (val == LOW) {
if (valor >=10){
valor =2;
}else{
valor++;
}
}
digitalWrite(valor,ledState);
}
}

    if(ledState == LOW){
      ledState = HIGH;
    }
    else{
      ledState = LOW;
    }

Please put your code in its own window as seen in other posts. This can be done by placing

[code]and [/code]

around the code. This makes it easier for others to read.

Use Tools, Auto Format in the IDE to make it a readable format.

You are trying to set the value currentMillis in the variable declaration. It will not have the correct value at the time you are running the program.

Weedpharma