I need to highlight objects within loaded 3d model with glowfilter kind effect, but when I do that all the meshes highlighted even if I get one specific on mouseover event. If I use this:
protected function onItemOver(event:Event):void
{
var targetMesh:Mesh = event.target as Mesh;
var data:BitmapData = BitmapTexture(TextureMaterial(targetMesh.material).texture).bitmapData.clone();
// change the color of the image in blue
var texture:BitmapTexture = new BitmapTexture(data);
var material:TextureMaterial = new TextureMaterial();
material.texture = texture;
material.alphaBlending = true;
material.addMethod(new OutlineMethod(0xcc0000,10,true,true));
targetMesh.material = material;
}
I also get “Error: Error #3691: Resource limit error
at flash.display3D::Context3D/createTexture()” after some time.
If I just do: TextureMaterial(targetMesh.material).addMethod(new OutlineMethod(0xcc0000,10,true,true)); it outlines the whole model