You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/08/14 16:18:46 UTC

[jira] [Commented] (FLEX-15159) For each loop is unable to iterate through ArrayList

    [ https://issues.apache.org/jira/browse/FLEX-15159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14697082#comment-14697082 ] 

ASF GitHub Bot commented on FLEX-15159:
---------------------------------------

Github user roberthunt commented on the pull request:

    https://github.com/apache/flex-sdk/pull/18#issuecomment-131119385
  
    I would appreciate this being merged.


> For each loop is unable to iterate through ArrayList
> ----------------------------------------------------
>
>                 Key: FLEX-15159
>                 URL: https://issues.apache.org/jira/browse/FLEX-15159
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Collections
>    Affects Versions: Adobe Flex SDK 3.0 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Language Found: English
>            Reporter: Adobe JIRA
>
> 1. Make sure your imports are correct:
> import mx.controls.Alert;
> import mx.collections.IList;
> import mx.collections.ArrayList;
> 2. Create a function which looks like:
> private function foo() : void
> {
> 	var aList : IList = new ArrayList();
> 	aList.addItem("foo");
> 	
> 	for each (var s : String in aList)
> 	{
> 		Alert.show(s);
> 	}
> }
> 3. Call the function
>  
>  Actual Results: No message box is shown
>  
>  
>  Expected Results: A message box with the text "foo"
>  
> This becomes a problem when you don't know what implementation an IList variable will be bound to, ref: http://bugs.adobe.com/jira/browse/SDK-14837
>  Workaround (if any): use the for loop instead
> for (var i : int = 0; i < aList.length; i++)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)