# Changing the colour of an MC

**URL:** https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478
**Category:** flash
**Created:** [November 22, 2002, 12:18am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478 "2002-11-22T00:18:38Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![yorkshirepuddin](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yorkshirepuddin](https://forum.kirupa.com/u/yorkshirepuddin)
#### Post date: [November 22, 2002, 12:18am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/1 "2002-11-22T00:18:38Z")

</div>

Hello again,

I am trying to automatically change the colour of an MC when it comes into play and am having a few problem. I used the code I found in the Flash AS Help, but it’s not working.

Here’s what I used:

myColor = new Color(rollover);  
myColor = setRGB(0x993366);

Rollover is the instance of the MC I want to target.

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 1:21am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/2 "2002-11-22T01:21:37Z")

</div>

Try this…

```auto
myColor = new Color(rollover);
myColor.setRGB(0x993366);

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 1:41am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/3 "2002-11-22T01:41:10Z")

</div>

Thanks again lost … it didn’t work though … should i put in on the mc action or main timeline … i’m not sure if its not working because its inside an MC that acts as a button …

time for a break …

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 1:42am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/4 "2002-11-22T01:42:06Z")

</div>

I didn’t test that, I gotta go eat dinner now, I should be on later so if no one else solves the problem… I will be back…lol.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 2:11am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/5 "2002-11-22T02:11:09Z")

</div>

Untested again, but I just realized I forgot something…

```auto
myColor = new Color(_root.rollover);
myColor.setRGB(0x993366);

```

I forgot to add the \_root, it should work now, if not, I will experiment later.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 3:02am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/6 "2002-11-22T03:02:20Z")

</div>

nope … didn’t work …

here’s the deal … the target is within a mc acting as a button … the target is on the \_over state …

you’ve seen the nav … its the rollouts … each color should be diffent … rather than creating 3 graphics or tinting … i thought i’d be able to just change the color through AS

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 4:22am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/7 "2002-11-22T04:22:12Z")

</div>

This is what I did and it works great…

I created a square… converted that to a movie clip.

Inside the square movie clip I created a circle (next to the square) and made that a movie clip with the instance name “circle” (no quotes).

I then went back to the \_root timeline and added these actions to my square movie clip…

```auto
onClipEvent (load) {
	circleColor = new Color(this.circle);
}
on (rollOver) {
	circleColor.setRGB(0xE6E6E6);
}
on (rollOut) {
	circleColor.setRGB(0x999999);
}

```

Works great 🙂 (except that since the circle is also part of the movie clip when you mouseover the circle it does the same thing, but I don’t know your exact situation so I am not going to bother with fixing it).

I attached the .fla if you want to check.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:09am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/8 "2002-11-22T05:09:11Z")

</div>

No fair … doesn’t work for me … I think it’s because I have it set up a little differently that you …

Here’s my setup …

MC1 - on main timeline acting as button

Within MC1 on \_over state, MC2 (animated) …

MC2 is what I’m trying to target … but the gods won’t let me …

Why, oh why, do they have to rain on my parade? _L_

Thanks for the help though. I could do with you with Flash as one of those helpers … you know … the kind that pop up in Microsoft Office and ask ‘can i help?’ … _L_

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:11am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/9 "2002-11-22T05:11:13Z")

</div>

LOL, I am not a paper clip…LOL.

Anywho, can you post a .fla???

Even if it is just a basic example one and not the real one.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:19am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/10 "2002-11-22T05:19:42Z")

</div>

LOL … nah … you’re the wacko scientist … or maybe the cute dog … _L_ … and hey … paper clips are handy you know …

Okay, give me a sec … I’ll strip the .fla down a little and send it along … although last time I tried to attach a .swf it wouldn’t let me … so god knows what it will do with my crazy .fla …

give me 10 mins … i need to switch burn it and transfer to this computer …

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:20am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/11 "2002-11-22T05:20:44Z")

</div>

Yes, I want to be a crazy scientist!!!

You can’t attach .swf files to the board, it doesnt work when you try to view.

As for .fla files, it should work fine as long as the size isn’t too big.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:24am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/12 "2002-11-22T05:24:34Z")

</div>

actually, i got a copy on this comp … here ya go …

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:28am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/13 "2002-11-22T05:28:55Z")

</div>

I don’t see your setRGB code, are you trying to change the RGB code on the object in your layer labeled “background”???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:30am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/14 "2002-11-22T05:30:48Z")

</div>

> \*Originally posted by lostinbeta \*  
> \*\*I don’t see your setRGB code, are you trying to change the RGB code on the object in your layer labeled “background”??? \*\*

oops … that one won’t have it … that’s an older version … the new one is on my laptop … yes … it’s the background layer … its an animated mc

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:37am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/15 "2002-11-22T05:37:44Z")

</div>

ok

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:52am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/16 "2002-11-22T05:52:55Z")

</div>

Sorry, got caught up in something. do you want me to post the other one?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:57am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/17 "2002-11-22T05:57:16Z")

</div>

No, that is ok.

I have a sneaking suspicion that it is because you use graphics in your movie clip, I am not sure though :-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 5:59am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/18 "2002-11-22T05:59:12Z")

</div>

> \*Originally posted by lostinbeta \*  
> \*\*I have a sneaking suspicion that it is because you use graphics in your movie clip, I am not sure though :-\ \*\*

Well that sucks eh?

Looks like I’m going back to just tinting… cheers me dears!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 6:01am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/19 "2002-11-22T06:01:07Z")

</div>

Well you could recreate your tweens without using graphic symbols.

I am going to test this now and let you know if it works.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 22, 2002, 6:06am UTC](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478/20 "2002-11-22T06:06:35Z")

</div>

really? i never know that … don’t go out of you way on my behalf … I’m just creating individual graphics for the rollovers … its only 3 …

[Next page](https://forum.kirupa.com/t/changing-the-colour-of-an-mc/8478.md?page=2)
