Functions as called on object scope already read variables you have created on objects. They also can add variables.
Code:
function create()
{
myVariable = 0;
}
function step()
{
//do something with myVariable
}
If an object has a create event that calls this create function, it will add an instance variable to that instance of the object(which ends up being all instances since they each will run the same code). If you put the step function there into the step event, it will have no problem accessing that same
myVariable variable to do something.
You may have something confused honestly. Local variables are the ones that you create with the
var keyword. They only exist in the code block they are created in. If you put one in a create event, it won't be usable in the step event either. Instance variables are the ones you create without that var keyword. They last through the lifetime of the instance, and can be accessed by any event of the object after it is created. The best practice is to init such variables in the create event.
FrostyCat also has a valid point. Many tutorials haven't been updated(though the manual shows it correctly). This error would indeed be caused by that.