Share on Google+Share on Google+

Flex Variables

Advertisement
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();

Advertisements

Posted on: April 19, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.