tags:

views:

153

answers:

2
var dd:Array = ["1", "2", "3"];
for each (var google in dd)
{
    Alert.show(google);
}

What will be the output for the following... i am getting only 1 in Alert window.

+3  A: 

Check Again

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001831.html

var myArray:Array = ["one", "two", "three"];
for each (var item in myArray) {
    trace (item);
}
// output:
// one
// two
// three

and I guess all alert shows one another above .. check it..

joe
A: 

Your code will open 3 alert dialogs on top of each other. The first one will be 1, on top of that 2 and then topmost 3.

Mircea Grelus