Go to content

Main menu:

All About Variables in Multimedia Fusion 2 and Clickteam Fusion

Last Updated: January 17th, 2016

All programming languages have different types of variables, such as CHARs, INTs, and STRINGs. MMFusion provides access and manipulation to three basic variable types; Bits (called flags), Strings, and Integers. This tutorial explains these types and noteworthy properties of each type. You will also explore the definition and usage of Global Variables, various restrictions placed on all MMFusion variables, and when you may access variables.


Quick Links:

Numerical Data
MMFusion provides 26 named Alterable Values for each variable object. In the later version of Clickteam Fusion (build b281.1 and higher) you access to have unlimited amount of Alterable Values during runtime if you access them through an index.

You may access Alterable Values through a variable object's "Property" tab and through various actions under the object in the Event Editor. During runtime, these variables are initialized with their edittime values. If the variable has no edittime value, it is initialized to 0.
Text Data
All MMFusion variable objects contain 10 Alterable Strings. Alterable Strings contain text of any length. Clickteam Fusion and Unicode versions of Multimedia Fusion 2 may contain use Unicode characters, such as Japanese Hiragana or other foreign characters, within the string.

Similar to Alterable Values, you can access Alterable Strings through a variable object's "Property" tab and through various actions under the object in the Event Editor. During runtime, these variables are initialized with their edittime values. If the variable has no edittime value, it is initialized to 0.
Image of an active object's property tab
Example of a variable object's "Properties" tab with example Alterable Variables.
Bits & Flags
Flags, called bits or booleans in other programming languages, are data types with exactly two values; on (also referred to as true or 1) and off (also referred to as false or 0). In MMFusion, all variable objects contain 32 flags. These flags can be accessed through an index, from 1 to 32. 

These flags are accessible only at runtime. Additionally, flags are turned off by default.

Global Variables
Global Variables are variables whose values persist between frames. Alterable Variables are associated with a given object or extension.

Whereas Alterable Variables are categorized into Alterable Values, Alterable Strings, and Flag; Global Variables are categorized into Global Values and Global Strings. 

Global Values behave the same as Alterable Values though Global Values are associated with the entire application while Alterable Values are held by individual objects.
Global Strings behave the same as Alterable Strings though Global Strings are associated with the entire application while Alterable Strings are held by individual objects. 

As a final note on the matter, one key difference between Global Variables and Alterable Variables is that an application has unlimited Global Values and Global Strings during edittime and runtime. Objects may have unlimited Alterable Values only during runtime. During edittime, you only have access to 26 Alterable Values and 10 Alterable Strings.
Variable Objects
In this tutorial, variable objects are objects which contain Alterable Variables. Active objects, for example, are a variable object since they contain Alterable Values and Alterable Strings in the object's "Properties" tab. The File object, for example, is not a variable object since it does not contain any Alterable Variables. 

You may see the term Varjects and VObjects as other terms for variable objects.
Object Oriented Variables
Alterable Variables are object-oriented variables (OOVs). These variables can be used to manipulate an event's object scope, explained and described in the Object Scoping and Object Selection tutorial. 

Edittime Access
During edittime, you have access to unlimited Global Values, unlimited Global Strings, 26 Alterable Values per object, and 10 Alterable Strings per object. Object Flags cannot be accessed during edittime.
Runtime Access
During runtime, you have access to unlimited Global Values, unlimited Global Strings, 26 (or unlimited) Alterable Values per object, 10 Alterable Strings per object, and 32 Flags per object. 

Variable Comparison Chart
 Global Variables Alterable Variables
Type
Global ValuesGlobal StringsAlterable ValuesAlterable StringsObject Flags
Number Available 
∞ 

build b281.1 and lowerbuild b281.2 and higher10 
32 
26 ∞
Edittime AccessYesYesYesYes. Only 26.YesNo
Runtime AccessYesYesYesYesYes

Summary
In conclusion, MMFusion contains three data types for user manipulation; numericals, strings, and Flags (bits). Global Values and Alterable Values are examples of the numerical data type, Global Strings and Alterable Strings are examples of the string data type, and Object Flags are examples of the Flag data type. Numericals and strings may be accessed during edittime in the "Properties" tab of an object or the application. Object Flags are accessible only during runtime.

Numerical and string variables initialize to their edittime value if such a value is specified. Otherwise a default value of 0 and "" are used for each variable respectively. Object Flags, which cannot be accessed during edittime, are always initialized to off
Understanding the different variable types in MMFusion is crucial to application development in MMFusion.

The tutorial PDF located in the "Downloads" section contains additional information about limitations of Global Variables and Alterable Variables.

Rate This Tutorial
Vote: 3.1/5
If you have read this tutorial, rate it from poor (1) to average (3) to great (5)!
Back to content | Back to main menu