Why does this fail?

this.createEmptyMovieClip("bob", this.getNextHighestDepth());
trace("created bob");
count = 0;
bob.onEnterFrame = function() {
count++;
trace("have entered frame "+count+" times");
if (count > 5) {
	trace("	attempting to stop");
	stop(); // FAILURE
}
}

any ideas?