Newbie - publish as v5 or v8 error

Howdy Do,

I have a movieclip named box.
The code below has been entered into a frame.

box.onEnterFrame =function()
{
y = this._y;
dy = (dy+(200-y)/2.8)/1.4;
y += dy;
this._y = y;
}

If I publish as Flash 5 it works - if I publish as Flash 8 it doesn’t work.
What am I missing?
thx,
Nos