RE: [Flashcoders] +Infinite Loop -Dignity
I feel really stupid right now. No, not that stupid. I mean really stupid. Take the highest level of stupid you can imagine and double that. Yes, now you've got it! I have a class named Game. Game.start() calls setInterval(this, update, 1000). Game.update() calls _gameScene.update(). _gameScene.update() has the following loop inside of it: for (var i:Number = 0; i != elements.length; i++) { elements[i].animation.update(); } That FOR loop puts my humble PC into a coma. The variable 'elements' is not undefined, and when I call trace(elements.length) I get '2'. I tried clearing ASO cache (whatever that's worth right now) as a silly precaution. Excuse me whilst I hang myself. I can't quite tell from your post whether you've solved the problem or not! If not, my guess is that the animation.update() call is triggering the other update events. Any chance the _gameScene object has found its way into elements. Have you tried the debugger? Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] +Infinite Loop -Dignity
This will happen if elements.length is undefined. i will never equal undefined. Use i elements.length P -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of daniel Sent: Tuesday, July 10, 2007 11:52 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] +Infinite Loop -Dignity I feel really stupid right now. No, not that stupid. I mean really stupid. Take the highest level of stupid you can imagine and double that. Yes, now you've got it! I have a class named Game. Game.start() calls setInterval(this, update, 1000). Game.update() calls _gameScene.update(). _gameScene.update() has the following loop inside of it: for (var i:Number = 0; i != elements.length; i++) { elements[i].animation.update(); } That FOR loop puts my humble PC into a coma. The variable 'elements' is not undefined, and when I call trace(elements.length) I get '2'. I tried clearing ASO cache (whatever that's worth right now) as a silly precaution. Excuse me whilst I hang myself. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
I heard using FOR is very slow. Instead, try WHILE (much faster): var i = -1; while (++ielements.length) { elements[i].animation.update(); } On 7/11/07, Pete Miller [EMAIL PROTECTED] wrote: This will happen if elements.length is undefined. i will never equal undefined. Use i elements.length P -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of daniel Sent: Tuesday, July 10, 2007 11:52 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] +Infinite Loop -Dignity I feel really stupid right now. No, not that stupid. I mean really stupid. Take the highest level of stupid you can imagine and double that. Yes, now you've got it! I have a class named Game. Game.start() calls setInterval(this, update, 1000). Game.update() calls _gameScene.update(). _gameScene.update() has the following loop inside of it: for (var i:Number = 0; i != elements.length; i++) { elements[i].animation.update(); } That FOR loop puts my humble PC into a coma. The variable 'elements' is not undefined, and when I call trace(elements.length) I get '2'. I tried clearing ASO cache (whatever that's worth right now) as a silly precaution. Excuse me whilst I hang myself. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
Decrementing is faster than incrementing. var i:Number = elements.length; while (--i) { elements[i].animation.update(); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
Oops! var i:Number = elements.length; while (i--) { elements[i].animation.update(); } Steven Sacks wrote: Decrementing is faster than incrementing. var i:Number = elements.length; while (--i) { elements[i].animation.update(); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
Why are you using INSANELY long variable names like 'element' and 'animation'? And why the spaces? Shouldn't that read: var i:Number = a.length; while(i--)a[i].n.t(); :-) Before anyone flames me... I'm kidding. Jim ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
while(i--)a[i].n.t(); You ain't what? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] +Infinite Loop -Dignity
serious... about this. Jim On 7/11/07, Steven Sacks [EMAIL PROTECTED] wrote: while(i--)a[i].n.t(); You ain't what? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] +Infinite Loop -Dignity
Is it possible that the i != elements.length inside the for loop leads to trouble? Maybe if it's change to ielements.length will be ok Best Regards, Enrico M Tumilisar Interactive and Multimedia Developer - www.digi-can.com +62.815.922.42.63 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of daniel Sent: Wednesday, July 11, 2007 10:52 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] +Infinite Loop -Dignity I feel really stupid right now. No, not that stupid. I mean really stupid. Take the highest level of stupid you can imagine and double that. Yes, now you've got it! I have a class named Game. Game.start() calls setInterval(this, update, 1000). Game.update() calls _gameScene.update(). _gameScene.update() has the following loop inside of it: for (var i:Number = 0; i != elements.length; i++) { elements[i].animation.update(); } That FOR loop puts my humble PC into a coma. The variable 'elements' is not undefined, and when I call trace(elements.length) I get '2'. I tried clearing ASO cache (whatever that's worth right now) as a silly precaution. Excuse me whilst I hang myself. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.2/894 - Release Date: 7/10/2007 5:44 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.2/894 - Release Date: 7/10/2007 5:44 PM ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] +Infinite Loop -Dignity
Why do you have so many hoops to jump through? Try changing your for loop to this: for (var i:Number = 0; i elements.length; i++) David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of daniel Sent: Tuesday, July 10, 2007 11:52 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] +Infinite Loop -Dignity I feel really stupid right now. No, not that stupid. I mean really stupid. Take the highest level of stupid you can imagine and double that. Yes, now you've got it! I have a class named Game. Game.start() calls setInterval(this, update, 1000). Game.update() calls _gameScene.update(). _gameScene.update() has the following loop inside of it: for (var i:Number = 0; i != elements.length; i++) { elements[i].animation.update(); } That FOR loop puts my humble PC into a coma. The variable 'elements' is not undefined, and when I call trace(elements.length) I get '2'. I tried clearing ASO cache (whatever that's worth right now) as a silly precaution. Excuse me whilst I hang myself. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com