PDA

View Full Version : Making Flash Think Faster



bandinopla
July 5th, 2005, 10:58 PM
Hi,
what is more fast and efficient?
this:
mc=_root.attachMovie(...,...,...); mc.onEnterFrame= doSomething

or, have all the names or the objects in an array and:
for(i=0...)
{
doSomethingWithThis(_root[array[i]])
}<array.lenght ;="" i="" dosomethingwiththis(array[i="" }=""><array.lenght ;="" i="" dosomethingwith(array[i="" }="">

</array.lenght></array.lenght>Another thing... I want to read something about writing efficient code for flash making games...

That example is bicouse... for example in a game that is required an X numbrer or... lets said... comets falling, like a shooting game, I dont whant to make flash think a lot... so my PC can play to, U know.

OK, bye.

Blackspirit
July 5th, 2005, 11:15 PM
I would say the for loop one, putting an onEnterframe on lots of clips is not very efficient.
I've head for(i in myArray) is faster then for(i=0;i<10;i++) as well....