I can't blend the layers together
I want to make my object works like this car example: http://www.adobe.com/devnet/actionscript/samples/drawing_4.html
I have a building and I just want to change the color of the doors, gutters... when the user clicks a title. Very simple. Just like in the above example. I follow the example above.
My button click works. Changing color code works, but my shade is display on top and does not show my color. I called in for support, but they told me to post my question in the forum.
in the code below doorColorMC is a movieClip for my door.
The order layers is: script, shade, doorColor, background.
Please help. Thanks
-------------------------------------------------------------------------------------------- !
import fl.data.DataProvider;
import flash.events.MouseEvent;
import flash.geom.ColorTransform;
import flash.geom.Transform;
import flash.display.MovieClip;
var aDoorColors:Array = new Array(0x000000, 0xFF0000, 0x0000CC, 0x00CC00, 0xFFFF00);
var aDoorColorNames:Array = new Array("Cedar Red", "Garnet", "Continental Brown", "Bright White", "Iced White");
var dpDoorColorNames:DataProvider = new DataProvider();
var boxArray:Array = new Array();
loadDoorColors();
stop();
function loadDoorColors():void
{
for(var i:int=0; i < aDoorColors.length; i++)
{
boxArray = new Shape();
// Draw box w next color in array
drawBox(boxArray, aDoorColors);
// Add label and box to boxesDp
dpDoorColorNames.addItem( {label:aDoorColorNames, source:boxArray} );
}
// Assign box DataProvider to the TileList
doorTile.dataProvider = dpDoorColorNames;
doorTile.columnWidth = 110;
doorTile.rowHeight = 110;
//tileDoor.rowCount = 2;
doorTile.setSize(1120,115);
//tileDoor.move(10, 10);
doorTile.setStyle("contentPadding", 5);
}
function drawBox(box:Shape,color:uint):void
{
box.graphics.beginFill(color, 1.0);
box.graphics.drawRect(0, 0, 80, 80);
box.graphics.endFill();
}
// Add handler for Button clicks
doorTile.addEventListener(MouseEvent.CLICK, tileDoorClickHandler);
function tileDoorClickHandler(event:MouseEvent):void
{
var clickedLabel = event.target.label;
var clickedIndex:int = aDoorColorNames.indexOf(clickedLabel,0);
if (clickedIndex > -1)
{
var colorTrans:ColorTransform = new ColorTransform();
colorTrans.color = aDoorColors[clickedIndex];
doorColorMC.transform.colorTransform = colorTrans;
//doorColorMC.transform.colorTransform = new ColorTransform(0,0,0,1,0,0,200);
}
//trace(clickedLabel);
//trace(clickedIndex);
}
