Working with variables
Every single programming language in the world makes use of variables to store and retrieve data to and from the memory of the computer. ActionScript and JavaScript are no exception! In Captivate, it is enough to know that a variable is a named space in the memory of the computer in which data can be read or written.
To make a long story short, a variable is made up of two things:
- Name: This name must comply with strict naming rules and conventions. In ActionScript, for instance, the name of a variable cannot contain any spaces or special characters (such as, @, é, è, ç, à, #, ?, /, and so on). When writing a script, the programmer uses the name of the variable to access the data it holds.
- Value: This is the piece of data that the variable contains. This value can change (vary) during the execution of the script or each time the script is executed, hence the name, variable.
For example, v_firstName = "Damien"
defines a variable:
v_firstName...