Your original error implied that actors was an array and element [i] of the array did not have a property/field named 'id'. It is caused by the reference to actors[i].id in this line:
CF.widget("BTN_ON_" + (i+1)).onPress = PowerOnUnit(actors[i].id);
Have you examined exactly what is being returned by the JSON script into the variable named data? Are you sure the content is correct?
I am also curious as to why you need the closure? The closure should work properly but I'm not sure why you need it.
Please see next post. Posted again vs editing!
Last edited by Lyndel McGee on November 30, 2010 20:51.