@Omer
Just a couple of comments on the previous dis cussion in this thread
1) You are correct that nodom is not available
2) If you code consists of a single loop which consists of updating all the visible elements then calling setTimeout again and if a single call to setInterval as a replacement for the setTimeouts you dhould seriously consider app.Animate as a replacement because you should be able to use it to make your movement smoother
Now about Batch()
Probably the main speed bottleneck to DroidScript is the JavaScript > java bridge
It is the mechanism used to call java functions from DroidScript's JavaScript whe it calls an app.*** method
1single call across the bridge is barely noticeable but if your app makes multiple calls across the bridge before anything happens on the screen this begins to get noticeable
Batch addresses this for the specific situation where multiple values need to be set for one control by accomplishing them in a single call across the bridge
This is pasted from a post by Alan in the beta group:
//////////
For a Text Box these work
var q = app.AddText( qlay,qtxt )
q.Batch({
SetBackColor_: ["#333333"], // note underscore
SetTextColor: [ "#999999" ],
SetPadding_: [20,20,20,20,"px"], // note underscore
SetMargins_: [20,20,20,20,"px"], // note underscore
SetTextSize: [32,""],
SetOnTouchDown: [q_OnTouch]
})
//////////
A couple of complications:
a) Batch does not waste time counting methods so it is our responsibility to pass all the parameters. Any you would ignore when coding, pass null or ""
b) Some controls use base methods rather than methods specifically created for them, for instance the Text control does not actually have a SetBackColor method, it inherits that method from it's parent object.
In those circumstances we add an underscore to the method name as above
Gone() and Hide() are other examples