Skip navigation
sachin_mak
Currently Being Moderated

How to Compare colors of two Movie Clip?

Jul 29, 2012 10:12 PM

Hello every one,

 

 

I have a movie clip which is a line. This movieclip is rotating 90 degree on mouseclick I have taken 3 movie clips and  i want to change their color on some condition.

 

if 1_mc hit 2_mc then color of both will change into red and if not then color of both will remains Black.

 

if 2_mc hit 3_mc and color of 2_mc is red then color of 3_mc will change into red. otherwise color of both 2_mc and 3_mc will remains black.

 
Replies
  • kglad
    62,157 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 29, 2012 10:59 PM   in reply to sachin_mak

    i already showed you how to do this and pointed out the problem you're having is you're failing to repeatedly execute the suggested code.

     
    |
    Mark as:
  • kglad
    62,157 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 30, 2012 7:26 AM   in reply to sachin_mak

    to start you need to change those movieclip references:

     

    var ct:ColorTransform=new ColorTransfor();

     

    .

    .

    .

    if(mc_1.hitTestObject(mc_2)){

    ct.color=0xff0000;

    } else {

    ct.color=0x000000;

    }

    mc_2.transform.colorTransform=ct;

    if(mc_2.hitTestObject(mc_3)){

    mc_3.transform.colorTransform=ct;

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points