Flex 修改shape颜色的方法
?flash打包资源成swc组件,在flex中引用 修改shape颜色的方法如下: var child:Shape = mc.getChildAt(jj) as Shape; var newTranColor:ColorTransform = child.transform.colorTransform; //var newMatrix:Matrix = child.transform.matrix; newTranColor.color = 0x00ff00; child.transform.colorTransform = newTranColor;
concatenatedMatrix 、
concatenatedColorTransform 和
pixelBounds )进行了说明。
transform 对象的每个属性本身都是一个对象。此概念很重要,因为设置 matrix 或 colorTransform 对象的新值的唯一方法是,创建新对象并将该对象复制到 transform.matrix 或 transform.colorTransform 属性。 例如,要增加显示对象矩阵的 var myMatrix:Matrix = myDisplayObject.transform.matrix; myMatrix.tx += 10; myDisplayObject.transform.matrix = myMatrix; 不能直接设置 myDisplayObject.transform.matrix.tx += 10; 您也可以复制整个 transform 对象并为其赋予另一个显示对象的 transform 属性。例如,下面的代码将整个 transform 对象从 myNewDisplayObj.transform = myOldDisplayObj.transform;
现在,新显示对象 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |