Flex Variables


 

Flex Variables

A variable is a reference to the value associated with it. Variables are used to store values for the application.

A variable is a reference to the value associated with it. Variables are used to store values for the application.
A variable is a reference to the value associated with it. Variables are used to store values for the application.

In flex, var statement is used to declare the variable.
var myVar:int;

Variable is assigned a value using assignment operator (=).
myVar = 10;

Declaration and assignment of the variable can be done simultaneously.
var myVar:int = 10;

The type of the variable can be any predefined type provided by flex or custom data type.
var myVar:MyClass = new MyClass();

Ads