Weird Variable Problem

What I’m trying to do is very simple. I have no idea why this is not working. All I am trying to do is move a movieclip by using a variable.

This does work:


onClipEvent(enterFrame) {
    _root.background.picture._x += .5;   
}

It moves the MC .5 pixels everytime the playhead enters the frame.

Now, I’m trying to simply change the .5 to a _global variable that I have. So I’m using:


onClipEvent(enterFrame) {
    _root.background.picture._x += _global.xspeed;   
}

For whatever reason, this causes my MC to disappear. I’ve even traced the _global.xspeed to see that the variable is even there and it is. The only thing that I can possibly see is that when I traced the variable _global.xspeed, the first thing for a nano second was “undefined”. After that it was all numbers.

How can I fix this? Is there a way to say “if _global.xspeed is a number then do this else don’t do anything”?