onEnterFrame/setInterval function is just to give spreading effect to the app. as I mention earlier, using for loop doesnt't let any animation play before loop ends. the real problem is only about the SEQUENCE-PATTERN. but, to make my question clearer 1. for example: there are 7000 nodes to count 2. using one variable such as i inside loop is OK, although using for loop to counts more than 2000 nodes make everything slows down for (var i=0; i<7000; i++) drawNodes();--> hangs!! but I want the counting process run faster by adding another variable which counts with different starting Number. thats is DIVIDING the drawing process into 7 part and run simultaneously as well 3. explaining my previous code: variable a counts ---> 1, 8, 15, 22 and so forth......adding 7 to prev number each time variable a counts ---> 2, 9, 16, 23 and so forth......adding 7 to prev number each time variable c counts ---> 3, 10, 17, 24 and so forth......adding 7 to prev number each time variable d counts ---> 4, 11, 18, 25 and so forth......adding 7 to prev number each time variable e counts ---> 5, 12, 19, 26 and so forth......adding 7 to prev number each time variable f counts ---> 6, 13, 20, 27 and so forth......adding 7 to prev number each time variable g counts ---> 7, 14, 21, 28 and so forth......adding 7 to prev number each time it is very much like telling 7 people to count 1000 number at different start and at the same time. As a result, the total 7000 nodes are ALL being read with shorter time. if only one such as variable "i" in many normal loop, then variable "i" would count one, two, three ........ up to...seven thousand (and a hospital await in front of "i") i guess there must be a math/words for this sequence and to achieve the result in a smarter way
Danny Kodicek <[EMAIL PROTECTED]> wrote: > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Erich Erlangga > Sent: 24 April 2007 14:27 > To: flashcoders@chattyfig.figleaf.com > Subject: [Flashcoders] WhITE SNOW and Seven Dwarf - MAth Problems! > //run 7 times faster for attaching symbol in the library > //(depends on how many people count) > var a = 1; > var b = 2; > var c = 3; > var d = 4; > var e = 5; > var f = 6; > var g = 7; > trace("first Number = " + a + " - " + b + " - " + c + " - " + > d + " - " + e + " - " + f + " - " + g); > trace("Next Number =" + newline); > _root.onEnterFrame = function(){ > > a +=7; > b +=7; > c +=7; > d +=7; > e +=7; > f +=7; > g +=7; > > trace(a + " - " + b + " - " + c + " - " + d + " - " + e + " > - " + f + " - " + g); > if (g == 70){ > delete _root.onEnterFrame ; > } > > } Yes, that does look a bit odd. How about something like: var tIndex = 1 _root.onEnterFrame = function() { for (var i=0; i<7 i++) { trace(tIndex++) } if (tIndex == 70) { delete _root.onEnterFrame } }; 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 --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. _______________________________________________ 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