我正在制作两个拾色器框。通过这两个颜色选择器框,我正在更改特定电影剪辑的颜色。我使用以下代码:
for (var i:int = 0; i < 1; i++)
{
color_picker(i)
}
var colorBox:ColorPicker;
var mc:MovieClip= new MovieClip()
addChild(mc)
function color_picker(p)
{
colorBox = new ColorPicker();
mc.addChild(colorBox);
colorBox.x = 0
colorBox.y = p * 40;
p++;
colorBox.addEventListener(ColorPickerEvent.CHANGE, changeColor1)
}
var colorTransform1:ColorTransform = new ColorTransform();
function changeColor1(Event:ColorPickerEvent)
{
var color = "0x" +Event.currentTarget.selectedColor.toString(16);
colorTransform.color = color;
cards.getChildAt(0).transform.colorTransform = colorTransform;
}
这样,我只能访问最后一个颜色选择器框。请指导我