           obj.position.y = pos.y
           obj.rotation.z = pos.a
 
-      spawnCube = ->
+      spawnCube = (w)->
         _cube = Cube(w / 50)
         _scene.add(_cube)
 


        #TODO display message if Webgl required
        _renderer = new THREE.CanvasRenderer()
      _renderer.setSize(w, h)
      _renderer.setClearColorHex(0xEEEEEE, 1.0)
      _renderer.clear()
      container.appendChild(_renderer.domElement)

      # Lights
      #_scene.add( new THREE.AmbientLight( 0xFFFFFF ) );

          when "MoveObjTo"
            moveObjTo(e.objId, e.pos)
          when "SpawnCube"
            spawnCube(container.clientWidth)
          when "DespawnObj"
            despawnObj(e.objId)
          else
