Nieuw lid |
|
en met een reset (continue loop)
var breedteX:Array = new Array(2, 4, 6, 8, 9);
var index:Number = -1;
function move_rechts() {
index <= breedteX.length-2 ? index++ : index=0;
elementen = Number(breedteX[index]);
trace(elementen+" <= elementen | index => "+index);
}
function move_links() {
index<=0 ? index = breedteX.length-1 : index--;
elementen = Number(breedteX[index]);
trace(elementen+" <= elementen | index => "+index);
}
//test knoppies
up.onRelease = function() {
move_rechts();
};
down.onRelease = function() {
move_links();
};
var breedteX:Array = new Array(2, 4, 6, 8, 9); var index:Number = -1; function move_rechts() { index <= breedteX.length-2 ? index++ : index=0; elementen = Number(breedteX[index]); trace(elementen+" <= elementen | index => "+index); } function move_links() { index<=0 ? index = breedteX.length-1 : index--; elementen = Number(breedteX[index]); trace(elementen+" <= elementen | index => "+index); } //test knoppies up.onRelease = function() { move_rechts(); }; down.onRelease = function() { move_links(); };
|