Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-14-2008, 04:46 PM   #1
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default Problem with continue statement and label statement

What am I doing wrong?
ActionScript Code:
var a = {     a:[1,2,3,4,5,6,7,8,9,0],     b:[1,2,3,4,5,6,7,8,9,0],     c:[1,2,3,4,5,6,7,8,9,0],     d:[1,2,3,4,5,6,7,8,9,0],     e:[1,2,3,4,5,6,7,8,9,0],     f:[1,2,3,4,5,6,7,8,9,0],     g:[1,2,3,4,5,6,7,8,9,0] } outerLoop: for(var i in a){     trace(i);     for(var j in a[i]){         trace(' '+j);         continue outerLoop;     } }

Quote:
1039: Target of continue statement was not found.
abeall is offline   Reply With Quote
Old 07-14-2008, 09:01 PM   #2
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

Huh... tested it again. Seems to be a bug, whenever I try to use continue on labeled for-in or for-each loop it spits at me some hundred lines of stack trace and finally ends up in

Code:
VerifyError: Error #1068: int and * cannot be reconciled.
	at Untitled_fla::MainTimeline/Untitled_fla::frame1()
If you need a workaround, you may use Proxy class. It allows overriding for-in looping of object's properties... And, may be, submit the bug report to Adobe here:
http://www.adobe.com/cfusion/mmform/...?name=wishform
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it

Last edited by wvxvw; 07-14-2008 at 09:26 PM.
wvxvw is offline   Reply With Quote
Old 07-14-2008, 09:36 PM   #3
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default

Ah... but 'continue' works fine in a for..in/each loop:
ActionScript Code:
var a = [0,1,2,3,4,5,6,7,8,9]; for(var i in a){     if(a[i] > 4) continue;     trace(a[i]) }

I guess it's a bug just when you use a label to target an outer loop...
abeall is offline   Reply With Quote
Old 04-07-2011, 03:06 PM   #4
actiodbvxnscri
Registered User
 
Join Date: Apr 2011
Posts: 1
Default this piece works fine with continue and label

Loop1:for each (var feature:Feature in featuresArr)
{
Loop2:for each (var myIndicator:Indicator in myIndicatorArray)
{
if (myIndicator.dataType == "int")
{
var crtVal:Number = Number(myIndicator.getVal(feature));
if (isNaN(crtVal))
continue Loop1;
trace("crtVal "+crtVal);
}
}
returnList.push("temp");
}
actiodbvxnscri is offline   Reply With Quote
Old 04-07-2011, 06:21 PM   #5
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

The first one was a for-in loop, that's not the same as for-each... but times changed since that was posted. It could've been fixed since then (the post is almost 3 years old, it was FP9 then).
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Old 04-08-2011, 10:30 PM   #6
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default

Hey I remember this. Never got it working. I just tried my original code again and got lots of crazy bytecode errors, culminating in:

Quote:
VerifyError: Error #1068: int and * cannot be reconciled.
Not sure what that means. I tried adding variable typing and got the same error. I'm also not sure why I was doing trace(' ' + j) instead of trace(j) but that didn't make a difference.
__________________
Aaron Beall | Flash portfolio | Fireworks extensions | Twitter
abeall is offline   Reply With Quote
Old 04-09-2011, 09:53 AM   #7
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

That would mean that the compiler had generated invalid assembly - this error means that the value on stack isn't convertible to integer. It's hard to say what was on stack when it crashed, and why would it try to convert it to integer. You'd need to disassemble the function and see what exactly it does. I'm a bit too lazy to do it now
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash statement Problem TRixation2008 ActionScript 2.0 3 03-05-2008 04:47 PM
Conditional statement problem - frame labels? Head In A Pan ActionScript 2.0 1 02-20-2007 08:32 PM
Problem w/ if statement ryanbutler ActionScript 2.0 6 07-22-2005 04:55 PM
if statement problem ginrikki ActionScript 2.0 8 04-06-2005 10:35 PM
label statement in JavaScript matt poole ActionScript 1.0 (and below) 2 02-07-2003 12:25 PM


All times are GMT. The time now is 08:05 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.