Be a Supporter!

for & lag?

  • 201 Views
  • 3 Replies
New Topic Respond to this Topic
Yambanshee
Yambanshee
  • Member since: Oct. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
for & lag? 2009-03-22 06:52:47 Reply

i was just wondering, how much do for loops make flash lag? for example, if everyframe i had a for loop running (lets say) 150 times, will it cause any lag?


AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature
dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to for & lag? 2009-03-22 07:00:25 Reply

At 3/22/09 06:52 AM, Yambanshee wrote: i was just wondering, how much do for loops make flash lag? for example, if everyframe i had a for loop running (lets say) 150 times, will it cause any lag?

flash isn't that pathetic :P


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to for & lag? 2009-03-22 07:12:09 Reply

Really depends what you're doing inside the loop. If you're simply incrementing a number, it doesn't make much difference whether you loop 15 or 15000 times


- - Flash - Music - Images - -

BBS Signature
Yambanshee
Yambanshee
  • Member since: Oct. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to for & lag? 2009-03-22 07:30:05 Reply

sounds good. Basicly what im doing is at the moment i have a top view shooter. I decided that instead of a bunsh of for loops, ill make a mc with a alpha of 100 go to the bullet's path. Its also the total size of what the bullet is going to cover. This method worked great, but now that ive introduced 4 typed of weapons, that means a if statment with about 20 odd lines per weapon. IM guessing this in its self aint great for anti lag...


AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature