Let me start fresh on this question. I'm creating a 2d game with panels. I have a border panel for my user interface, and a series of inside panels for the game itself. For now (until i get the hang of this system), all of my panels are onscreen but in the future i want to be able to have offscreen panels as well.

I'm trying to write a function that allows me to zoom in and out on the inside panels using the mouse wheel. My first attempt allows me to make the section I'm zooming bigger, but curiously enough it doesn't matter which way I spin the wheel, the result is always larger. My second problem is that the smaller versions of the section I'm zooming don't go away, resulting in a messy and sort of blurry effect. Here's the code I'm working with so far:

function zoom()
{
while(1)
{
object1.scale_x = (mickey.z*0.1*time_step);
object1.scale_y = (mickey.z*0.1*time_step);
wait(1);
}
}

Pappenheimer suggested I add a + prior to the =, but that didn't really solve anything. Any suggestions?