I have a spinning globe, each country is a different color in one big bitmap. Each color performs a different method when clicked. It works fine 2D, The problem is I cannot get it to work when the object becomes 3D. I am new to Away3D so I assume this is a basic question, but how do I do this? This is my code:
var img:MovieClip = new worldMap() as MovieClip;
// create a BitmapData object with the following parameters: width, height, transparent, color
var bmpData:BitmapData = new BitmapData(img.width, img.height, true);
// draws a copy of the img MovieClip in to the BitmapData
bmpData.draw(img);
// adds a Bitmap to the stage with the BitmapData (copy of the img1) information to display
var bmp:Bitmap = new Bitmap(bmpData);
bmp.y = img.height;
addChild(bmp);
var newMaterial:MovieMaterial = new MovieMaterial(img);
//makes the material
var sphere:Sphere = new Sphere({material:newMaterial, radius:300,segmentsH:18,segmentsW:26});
view.scene.addChild(sphere);
//create globe and adds to view.
sphere.addEventListener(MouseEvent3D.MOUSE_UP,doIt);
function doIt(event:MouseEvent3D):void
{
trace('hit');
var pixelInformation:uint = bmpData.getPixel32(mouseX, mouseY);
trace(pixelInformation, pixelInformation.toString(16));
var jank = pixelInformation.toString(16);
if (jank == 'ff0000ff') {
trace('different color');
}
}