This is so old school and there are probably better ways to
do this now, but the simplest solution would be on frame 1 to add
Or whatever the original speed should be.
I think it was at Flash 7 when you needed to initialize
variables before you could use them. In earlier versions the value
of xspeed (on the right hand side) the first time around would have
defaulted to zero, but now it just doesn't compute at all.