load multiple objects

hello all, i have a question. i´m loading multiple objects with the command “for i in range(15):”, but i want to show one model each handlerEvent. take a look:

  for i in range (4):
      self.bola[i] = loader.loadModelCopy("models/smiley")  
      i = i + 1

  self.accept('space', self.new)

def new(self):
   i = i + 1

that is it, but it´s not working. someone have a tip?

your ‘i’ variable in new() doesn’t have a large enough scope. It is destroyed once new() completes. You need something like:

self.i += 1