From Test-Scratch-Wiki

Translate: - English 
Archive.png This article or section documents a feature not included in the current version of Scratch (2.0). It is only useful from a historical perspective.

In Scratch 1.x, Variables that are hidden when the project is shared lose their locations. The cure is to make sure that all variables are visible and in the correct location when the project is shared, then have a green flag script hide the ones that need to be hidden when the project starts up.
when gf clicked
show variable [variable v]
wait (0.01) secs
hide variable [variable v]