Global variables and toolbar button.
Hi there, running a script in my editor is working fine, can't see what's wrong. Then when the same script is executed via a button in a toolbar, it seems to lose the
defined global variable 'gFeatherPx'....? Any ideas? Thanks a mil.
Run in my script editor - correctly.
----------------------------------------------------------
alert(gFeatherPx) // gives 5 from a global.
if(!gFeatherPx){var gFeatherPx = 12;}
alert(gFeatherPx) // gives 5 from a global.
----------------------------------------------------------
Run from a script invoking button in AFX... can't find the global var.
----------------------------------------------------------
alert(gFeatherPx) // gives undefined - can't find global.
if(!gFeatherPx){var gFeatherPx = 12;}
alert(gFeatherPx) //gives 12.
----------------------------------------------------------