Forum Moderators: open

Message Too Old, No Replies

Flash loops

         

stormshield

6:01 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



Hi all,

I've got this code in flash:

points=0;
if (drag1.hitTest(_root.hit1)) {
points=points+1;
}

if (drag2.hitTest(_root.hit2)) {
points=points+1;
}
if (drag3.hitTest(_root.hit3)) {
points=points+1;
}

As you can see what I do is repeat the same code many times, which looks kinda funny, because it could be done by a loop. Anyone know how to write one?

stormshield

6:55 pm on Mar 15, 2006 (gmt 0)

10+ Year Member



Hey, somebody has to know the answer :)