title: Associate loaded JSON files with a name for later access
body: <p>I would like to load multiple JSON files and control the visibility of their meshes. To achieve this, I associated them with their JSON file names. I got it working, but the solutions doesn't please me.</p>
  
  <p>I modified the THREE.JSONLoader and passed a new parameter to the callback function. So with every new release of three.js, I would have to patch the three.js file again.</p>
  
  <p>Here is my working solution (client side). See the new third parameter of loader.load(filename, callback, meshname).</p>
  
  <p>Is there a better solution, which doesn't need a patched three.js library?</p>
  
  <p>Thanks</p>
  
  <pre><code>// Load the JSON files
  var meshes = new Object();
  var jsonFileNames = ['assembly/part1.json', 'assembly/part2.json', 'assembly/part3.json'];
  for(var i = 0; i &lt; jsonFileNames.length; i++){
      var loader = new THREE.JSONLoader();
      var meshName = jsonFileNames[i].split("/")[1].split(".")[0];
      loader.load(jsonFileNames[i], function(geometry, meshName){
          mesh = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({vertexColors: THREE.FaceColors}));
          mesh.scale.set(0.2, 0.2, 0.2);
          mesh.doubleSided = true;
          scene.add(mesh);
          meshes[meshName] = mesh;
      }, meshName);
  }
  
  // ....
  
  // Access their meshes
  meshes[meshName].visible = true;
  </code></pre>