主题:  可以在两个mc hitTest的时候,让A的色彩变成B的呢?

apiapia

职务:普通成员
等级:1
金币:0.0
发贴:109
注册:2002/7/2 8:52:40
#12002/7/25 11:19:34
Color.getRGB

Availability


Flash Player 5.

Usage


myColor.getRGB()
Parameters


None.

Returns


Nothing. // 这边说没有返回值

Description


Method; returns the numeric values set by the last setRGB call.

Example


The following code retrieves the RGB value for the Color object instance myColor, converts it to a hexadecimal string, and assigns it to the value variable.

value = myColor.getRGB().toString(16); //那为何又转为16进制赋给 value 呢?

偶trace() 出来的时候却老为“0” 的值



apiapia

职务:普通成员
等级:1
金币:0.0
发贴:109
注册:2002/7/2 8:52:40
#22002/7/25 11:26:54
偶是想拖动 MM 碰到GG的时候,让GG的YAN色变成MM的。。

如何做到呢??谢谢,,///

/*

onClipEvent(enterFrame)
{//这个是在MM上
    gg_Color=new Color(_root.gg);
    mm_Color=new Color(_root.mm);
    if (_root.mm.hitTest(_root.gg))
    {
     //gg_Color.setRGB(mm_Color.getRGB());
        trace(mm_Color.getRGB());//本来偶想应当会返回值的,没想到却不行
        }
    }

*/
Flash 动画



CoolFire

职务:普通成员
等级:1
金币:1.0
发贴:301
注册:2002/3/5 20:09:51
#32002/7/25 11:37:43
你是想做出这种效果吗!!如果是的话有一种更好的办法。



apiapia

职务:普通成员
等级:1
金币:0.0
发贴:109
注册:2002/7/2 8:52:40
#42002/7/25 11:40:22

Flash 动画


onClipEvent(enterFrame)
{
    gg_Color=new Color(_root.gg);
    mm_Color=new Color(_root.mm);
    mm_now=mm_Color.setRGB(0xD95591);
    if (_root.mm.hitTest(_root.gg))
    {
        gg_Color.setRGB(mm_Color.getRGB(mm_now));//原来getRGB是返回
最后一次设的setRGB的色彩值啊,可是这里又有个问题,

就是Mc MM 上的字无法看出,而且GG被撞后,GG上的字也没有了, 为何这样子啊???
        //trace(mm_Color.getRGB());
        }
    }
Flash 动画