title: Modular Classes with Corona SDK
body: <p>I'm trying to create a class to spawn some new objects on my screen. I'm following <a href="http://coronalabs.com/blog/2011/09/29/tutorial-modular-classes-in-corona/" rel="nofollow">this tutorial</a></p>
  
  <p>My goal was to do something link this:</p>
  
  <pre><code>local box = box.new( "First", 0, 62 ) -- Spawn a Box on the Screen on X = 0, Y = 62
  </code></pre>
  
  <p>This is my class:</p>
  
  <pre><code> box.lua
  
  local box = {}
  local box_mt = {__index = box } -- metatable 
  
  function box.new (nome, x, y)
      local newbox = {
          local nome = display.newImageRect( "images/box.png", 210, 70 )
           newbox.x = x
           newbox.y = y
       }
       return setmetatable( newbox, box_mt )
  }
  end
  </code></pre>
  
  <p>so far just by doing a <code>require ("box")</code> on the level1.lua my game is crashing</p>
  
  <pre><code>This is the error
  Failed to parse error message: error loading module 'level1' from file '/Users/mc309bza/Desktop/Corona/Platform/level1.lua':
      /Users/mc309bza/Desktop/Corona/Platform/level1.lua:28: syntax error near 'function'
  </code></pre>
  
  <p>Any ideas? Thanks!</p>