Hello all,
I would appreciate some expert insight if anyone has the time.
I am using the code below to try and swap out an embedded image at runtime but the second (loaded) texture appears as grey when the mouse clicks. I am not getting any error messages though.
[Embed(source="../embeds/surface1.jpg")]
public static var surfaceDiffuse:Class;
...
_loader = new Loader();
var url:String = "surface2.jpg";
var urlReq:URLRequest = new URLRequest(url);
_loader.load(urlReq);
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onSceneResourceComplete);
...
Material = new TextureMaterial( Cast.bitmapTexture( surfaceDiffuse ) );
Material.gloss = 5;
Material.lightPicker = _lightPicker;
Material2 = new TextureMaterial( Cast.bitmapTexture( _loader.content ));
Material2.gloss = 5;
Material2.lightPicker = _lightPicker;
_shpere1 = new Mesh( new SphereGeometry( 100, 100, 80 ), earthMaterial );
...
private function stageMouseDownHandler( event:MouseEvent ):void {
_mouseIsDown = true;
_sphere1.material = Material2;
}
TIA