Seite 1 von 1

Maxscript: Rollouts and LOCAL variables

Verfasst: 25.05.2014, 21:53
von Simon

Code: Alles auswählen

(
		local testVar = 999

		rci = rolloutCreator "myRollout" "My Rollout"
		rci.begin()
		rci.addText ("fn lulu = ( testVar -= 1; print testVar )")
		rci.addcontrol #timer #searchTimer "Search Timer" paramStr:("interval:1000 active:true")
		rci.addHandler #searchTimer #tick codeStr:"lulu()"

		rci.end()
		createDialog rci.def width:100 height:100
)
This doesn't work because the variable testVar is defined local but the rollout is always created on a global scope! The variable testVar has to be global too!