The dxf1 in your example is not seen in the #Events because it is a local variable to the macro.
The dxf2 is global, because it is in the #Events.
You can move the dxf1 definition to the #Events and then both will be visible in both the #Events and also in the macro above the #Events.
In other words all variables which you want to be globally visible for both the macro and also for the #Events then you have to define the variable global and that can be done with defining it under the #Events.