actionscript 3 - Is there a difference between MovieClip(X) and X as Movieclip? -


this question has answer here:

maybe in performance.
i'm using movieclip(getchildbyname("x")).stop();
better (getchildbyname("x") movieclip).stop(); ?

results: (ui.getchildat(0) spectrumanalyzer) = 174 ms spectrumanalyzer(ui.getchildat(0)) = 200 ms

for programmer it's same - don't know if code doing same thing in 2 different ways. anyways difference 26 ms 1 mio iterations.

var sa:spectrumanalyzer = new spectrumanalyzer()     var ui:uicomponent = new uicomponent()     ui.addchild(sa)     addelement(ui)      var start:number = new date().gettime()      for(var i:int=0; i<1000000; i++){         (ui.getchildat(0) spectrumanalyzer)     }      var end:number = new date().gettime()      trace(end-start)      start = new date().gettime()      for(var i:int=0; i<1000000; i++){         spectrumanalyzer(ui.getchildat(0))     }      end = new date().gettime()      trace(end-start) 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -