How to use three.js in that way?

hi
how to set up image in this code ?

 var loadingScreen = {
    scene : new THREE.Scene(),
    camera : new THREE.PerspectiveCamera( 1, window.innerWidth / window.innerHeight, 0.1, 100),
    box : new THREE.Mesh( 
        new THREE.BoxGeometry(0.5,0.5,0.5), 
        new THREE.MeshBasicMaterial({ color:0x4444ff })
    )
} ; 

i know how to do this in that way

var loader = new THREE.TextureLoader();
var geometry = new THREE.BoxGeometry(w, h, d);
var material = new THREE.MeshPhongMaterial({map: loader.load(fullUrl+'/style/img/walls.jpg'),
   side:THREE.DoubleSide,
}) ;

var mesh = new THREE.Mesh( geometry, material );

thanks a lot

Maybe like so:

 var loadingScreen = {
    scene : new THREE.Scene(),
    camera : new THREE.PerspectiveCamera( 1, window.innerWidth / window.innerHeight, 0.1, 100),
    box : new THREE.Mesh( 
        new THREE.BoxGeometry(0.5,0.5,0.5), 
        new THREE.MeshBasicMaterial({ color:0x4444ff, map: new THREE.TextureLoader().load(fullUrl+'/style/img/walls.jpg') })
    )
} ;

Although it’s bad practice so create an instance of TextureLoader for each texture. Instead, a single loader object is sufficient and can be reused.