Example ====== Timecode - Enable/Disable ====== ^ by: | Gregory Haynes, Mar. 2016 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=4416 | ^ description: | Enable/disable/toggle timecode input | ^ remarks: | These macros are now factory default macros, and are shown here for documentation. | {{tag>enable disable toggle timecode}} ==== functions ==== * [[macros:function:actionscript.setproperty.boolean]] * [[macros:function:timecode.setenabled]] ==== affected properties ==== * [[macros:property:timecode.enabled]] ===== Code ===== Enable Timecode timer. ActionScript.SetProperty.Boolean("Timecode.Enabled", true) Timecode.SetEnabled(Timecode.Enabled) Disable Timecode timer. ActionScript.SetProperty.Boolean("Timecode.Enabled", false) Timecode.SetEnabled(Timecode.Enabled) Toggle Timecode timer. ActionScript.SetProperty.Boolean("Timecode.Enabled", !Timecode.Enabled) Timecode.SetEnabled(Timecode.Enabled) ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[macros:formats_and_syntax#xml_format|Formats and syntax]] These macros are a good example for keeping the programming core and the menu in sync - this is explained in [[macros:action_and_menus]]. * ''ActionScript.SetProperty.Boolean("Timecode.Enabled", true)'' sets the variable 'Timecode.Enabled', which in fact enables the timer AND sets the menu if the timecode menu is open. * ''Timecode.SetEnabled(Timecode.Enabled)'' sets the timecode timer to the value the variable 'Timecode.Enabled' is set to. * ''ActionScript.SetProperty.Boolean("Timecode.Enabled", !Timecode.Enabled)'' is explained in [[:macros:control_structures]]: it is a simple toggle logic which sets the variable 'Timecode.Enabled' to its counterpart: if it is enabled, it will be disabled - and vice versa. ===== How to use it ===== See [[macros:deploying]]. \\ Fire any of the macros if you want to enable/disable/toggle the macro timer. ~~DISCUSSION~~