JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit

: The issue tracker is now writable again and logged users can download files too. But note that our support is very LIMITED.

List of issuesList of issues

#1009 Wrong AS3 output in case of looping through ArrayCollection with 'for each' and 'for' with direct-index-access
Author: user devbn
Date created:
Type: bug
Visibility: Everybody
Assigned to:
State: closed Help

> What steps will reproduce the problem? Decompile test.swf file attached together with this issue. > What is the expected output? What do you see instead? EXPECTED: The method 'application1_creationCompleteHandler' in class 'test' must be something like this: var a:ArrayCollection = new ArrayCollection(["first","second"]); for each(var o:String in a) { trace(o); } for(var i:* = 0; i < a.length; i++) { o = a[i]; trace(o); } ACTUAL: var o:String = null; var i:* = 0; var a:ArrayCollection = new ArrayCollection(["first","second"]); for(for each(o in a) { trace(o); }; i < a.length; ) { o = a[i]; trace(o); i++; } > What version of the product are you using? Is it "nightly build"? Which operating system do you have? Using JPEXs FFdec version 6.0.1 > Please provide any additional information below. If the problem is related to a SWF file, attach it here, otherwise we can't help you. See attached files
Downloadtest.mxml (1 KiB)Downloadtest.swf (614 KiB)
P.S: I mean the expectation is that the decompiled source must have two separate FOR loop, but the actual only contains one loop followed by one ERROR loop statement WITHOUT 'for' keyword
There are 2 for keywords: for(for each(o in a) the first loop is inside your first parameter of your 2nd for loop, so this code is equivalent. (if it is allowed in AS, i don't know) So you can find the "for" keyword for the 2nd loop before your first loop:) But true, this is not so nice. (Even if it works)
This code causes compile error in FlashBuilder: Description Resource Path Location Type 1008: Attribute is invalid. /te/src line 20 Flex Problem 1084: Syntax error: expecting colon before leftparen. /te/src line 18 Flex Problem 1084: Syntax error: expecting identifier before for. /te/src line 16 Flex Problem 1084: Syntax error: expecting identifier before rightbrace. /te/src line 19 Flex Problem 1084: Syntax error: expecting identifier before rightparen. /te/src line 19 Flex Problem 1084: Syntax error: expecting rightparen before semicolon. /te/src line 19 Flex Problem 1084: Syntax error: expecting semicolon before leftbrace. /te/src line 17 Flex Problem
Looks like this is already fixed in 6.1.0, it was problem with for loop /debugline detection.
State: new→upgraded
Thank you!
I close this issue due to inactivity. Please create new issue if problem still exists.
State: upgraded→closed