The following code loops three times and creates three new variables, called
,
,
caption0
caption1
and
:
caption2
for (var i = 0; i<3; i++) {
set("caption"+i, "this is caption "+i);
}
trace(caption0);
trace(caption1);
trace(caption2);
See also
var
202
Chapter 5: ActionScript Core Language Elements
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?