Search Array


ok, hava value , want compare array filled values , find next bigger , next smaller value.

how can it?

 

i fugured out how search next bigger, how find 1 next smaller?

 

function comparevalue(mypoints) {

    var higherdone=0;
    (i=0; i<myarray.length; i++) {
        if (higherdone==0) {
            if (mypoints > myarray[i]) {

               trace("higher: " + myarray[i])
                higherdone=1;

            }
        }
    }

}

not knowing mean next higher , next lower based on looking @ code, code show couldn't finding higher value since comparison defies that.... if(mypoints > myarray[i]) .... tells me mypoints higher, you've found maybe consider next lower.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???