looping through display objects in storyboard

if object,_functionListener, touch or object._functionListeren.tap or object._tableListener.touch or object._tableListener.tap then

Tried that, but getting error that the _functionListener is nil… or any of the above variations.  Here is my code:

local stage = display.getCurrentStage()   for a = 1, stage.numChildren,1 do       if stage[a].x then      print ("stage Object type = " .. type(stage[a]) .. "  object = " .. tostring(stage[a])          .. " x=".. stage[a].x .. ", y=".. stage[a].y .. ", w=".. stage[a].width .. ", h=".. stage[a].height);         if stage[a].\_functionListener.touch or stage[a].\_functionListener.tap or stage[a].\_tableListener.touch or stage[a].\_tableListener.tap then             print("has a listener")         end     end   end  

Here’s the error:

attempt to index field ‘_functionListener’ (a nil value)

All of these objects on this particular scene have either a tap or touch listener and function.
 

try adding ~= nil to each condition check

already tried that, no matter what, all those are always nil.  But on this scene, all the display objects have either a tap or touch listener. 

need to check for _functionListener then for _functionListen.touch and tap. then same for _tableListener

Please keep in mind that our standard is to prefix **private** variables and methods with an underscore.  We are subject to change these attribute and method names at any time and without warning.  Use this technique at your own risk.

Rob

both stage[a]._functionListener and stage[a]._tableListener are nil on all of the objects.