I am creating a game where the user moves a ball (ball_mc) with the arrow keys or with the a,s,d,w keys.
This kind of game has been done plenty of times before but i want to switch the way the arrows work every five seconds or so.

so when the game starts I want the contols function to be active for five seconds and then switch to the switchedControls and let those be active for five seconds, and alternate between the too every five seconds if anyone knows how to do this than help would be greatly appreciated.

I tried setinterval but i dont think it can be done that way.
I think i would have to use gettimer but cannot figure out how to get that to work either \

heres the code for reference

thanx in advance.



Code:
stop();

//----------------------------FUNCTIONS---------------------------\\
var ballSpeed:Number = 5;

function moveRight () {
	if (ball_mc._x>0 && ball_mc._x<550) {
		ball_mc._x += ballSpeed;
	}
}
function moveLeft () {
	if (ball_mc._x>0 && ball_mc._x<550) {
		ball_mc._x -= ballSpeed;
	}
}
function moveUp () {
	if (ball_mc._y>0 && ball_mc._y<400) {
		ball_mc._y -= ballSpeed;
	}
}
function moveDown () {
	if (ball_mc._y>0 && ball_mc._y<400) {
		ball_mc._y += ballSpeed;
	}
}
//----------------------------FUNCTIONS---------------------------\\

//----------------------------KEY PRESS FUNCTIONS---------------------------\\
var keyListener:Object = new Object();
Key.addListener(keyListener);

function controls () {
	keyListener.onKeyDown = function () {
		onEnterFrame = function  () {
			if(Key.isDown(Key.RIGHT)) {
				moveRight();
			}
			else if(Key.isDown(Key.LEFT)) {
				moveLeft();
			}
			else if(Key.isDown(Key.UP)) {
				moveUp();
			}
			else if(Key.isDown(Key.DOWN)) {
				moveDown();
			}
			else if(Key.isDown(68)) {
				moveRight();
			}
			else if(Key.isDown(65)) {
				moveLeft();
			}
			else if(Key.isDown(87)) {
				moveUp();
			}
			else if(Key.isDown(83)) {
				moveDown();
			}
		}
	}
}

function switchedControls () {
	keyListener.onKeyDown = function () {
		onEnterFrame = function  () {
			if(Key.isDown(Key.RIGHT)) {
				moveLeft();
			}
			else if(Key.isDown(Key.LEFT)) {
				moveRight();
			}
			else if(Key.isDown(Key.UP)) {
				moveDown();
			}
			else if(Key.isDown(Key.DOWN)) {
				moveUp();
			}
			else if(Key.isDown(68)) {
				moveLeft();
			}
			else if(Key.isDown(65)) {
				moveRight();
			}
			else if(Key.isDown(87)) {
				moveDown();
			}
			else if(Key.isDown(83)) {
				moveUp();
			}
		}
	}
}
//----------------------------KEY PRESS FUNCTIONS---------------------------\\