So, I've run into another problem with JavaScript.
function actionMenuLeave () {
var xOne = 1;
var xTwoMove = 0;
var xTwo = 1;
var xThreeMove = 0;
var xThree = 1;
var xFourMove = 0;
var xFour = 1;
var i = 0;
while ( i =0 ) {
panelContext.clearRect (0,0,400,100);
if (xOne > 0) { xOne = xOne - .05; }
if (xOne = 0.5) { xTwoMove = 1;}
if (xTwoMove = 1) {xTwo = xTwo - .05;}
if (xTwo = 0.5) { xThreeMove = 1;}
if (xThreeMove = 1) {xThree = xThree - .05;}
if (xThree = 0.5) { xFourMove = 1;}
if (xFourMove = 1) {xFour = xFour - .05;}
if (xFour = 0) {i = 1;}
panelContext.fillStyle = "#FFAAAA";
panelContext.fillRect (0,0,100,(100*xOne));
panelContext.fillStyle = "#A89058";
panelContext.fillRect (100,0,200,(100*xTwo));
panelContext.fillStyle = "#AAAAFF";
panelContext.fillRect (200,0,300,(100*xThree));
panelContext.fillStyle = "#EEEEEE";
panelContext.fillRect (300,0,400,(100*xFour));
}
}
What this is supposed to do when it's called is make four menu boxes flatten down to nothing so that new boxes can appear in their place. The height of the boxes are multiplied by a number between one and zero to produce a shrinking rectangle instead of a square, but it doesn't work properly. I know that the function is being called in the right place, and I think that it could be that the function is performed really fast and then the menu gets drawn over again by some other function. I'm just posting this to ask if anybody sees another stupid mistake on my part in there.