Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6E4AC188C2 for ; Wed, 6 May 2015 10:06:00 +0000 (UTC) Received: (qmail 46163 invoked by uid 500); 6 May 2015 10:06:00 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 46141 invoked by uid 500); 6 May 2015 10:06:00 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 46116 invoked by uid 99); 6 May 2015 10:06:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 10:06:00 +0000 Date: Wed, 6 May 2015 10:06:00 +0000 (UTC) From: "Gareth Daniel Smith (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLEX-15159) For each loop is unable to iterate through ArrayList MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-15159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14530287#comment-14530287 ] Gareth Daniel Smith commented on FLEX-15159: -------------------------------------------- Any change this could be re-opened? This sort of thing makes Flex confusing to use (because this behaviour is unexpected) and slow (because I choose to use ArrayCollection instead of ArrayList purely because the former has a nicer API, despite it having more overhead). I would be willing to contribute a patch. > 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 > Assignee: 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)