# Replacing an MC which is masked

**URL:** https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773
**Category:** flash
**Created:** [July 26, 2004, 4:25am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773 "2004-07-26T04:25:20Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ratbaggy](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ratbaggy](https://forum.kirupa.com/u/ratbaggy)
#### Post date: [July 26, 2004, 4:25am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/1 "2004-07-26T04:25:20Z")

</div>

Hello Gurus,

Today, I am wondering how (or if it is possible) to replace a movieclip which is masked.

i.e. I have one movieclip which I want to “wipe” with another movieclip (which contains the same object but in a different colour (photo)). The colour is dependent upon which button is clicked. So…it would be nice to have a transition movie clip which will take the current colour MC and “wipe” it with the select colour MC.

Hope this makes sense…and thanks in advance.

---

<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: [July 26, 2004, 6:44am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/2 "2004-07-26T06:44:18Z")

</div>

_bump_

---

<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: [July 26, 2004, 7:09am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/3 "2004-07-26T07:09:12Z")

</div>

Why not have a movieclip with all the coloured photos in it, and upon button press go to the corresponding frame within that movieclip that shows that specific coloured photo, and then do your mask animation on that movieclip ? I’m not sure if I’m getting your situation correctly, but it looks to me like an excellent way to ‘replace’ a masked movieclip.

---

<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: [July 26, 2004, 8:04am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/4 "2004-07-26T08:04:00Z")

</div>

true…though perhaps I didn’t explain well…

the reason (that I can see) for not using this method is the transition would need to go from any colour to any colour. so a hard-copy version would be tricky work to add to and manage.

if I have misundertsood your suggestion please re-word (if you can be bothered) and forgive my tiredness. 😉

anymore help?

---

<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: [July 26, 2004, 8:09am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/5 "2004-07-26T08:09:35Z")

</div>

So you basically have a photo with a specific colour, and then a mask animation, over another photo with another colour so that the first photo reveals the other photo with the other colour ?

---

<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: [July 26, 2004, 8:14am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/6 "2004-07-26T08:14:59Z")

</div>

yes, but the pic which is wiped in is random then that has to replace the original so the process can begin again. it’s all random though except for the initial colour object

---

<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: [July 26, 2004, 8:28am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/7 "2004-07-26T08:28:12Z")

</div>

Yes, I see … let me create something for you.

---

<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: [July 26, 2004, 8:37am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/8 "2004-07-26T08:37:37Z")

</div>

you’ll have to twist my arm but…OF COURSE PLEASE DO CREATE SOMETHING, MUCH APPRECIATED

---

<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: [July 26, 2004, 9:05am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/9 "2004-07-26T09:05:59Z")

</div>

Is this what you were looking for ?

---

<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: [July 26, 2004, 9:26am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/10 "2004-07-26T09:26:13Z")

</div>

ooooer…yeah looks beauty bonza mate!! do you mind commenting the code or explain here?

at least then I don’t have to post in a few months with more annoying questions which I may have learnt from this question.

---

<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: [July 26, 2004, 9:29am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/11 "2004-07-26T09:29:04Z")

</div>

actually I thinks I get it. mostly

---

<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: [July 26, 2004, 9:31am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/12 "2004-07-26T09:31:19Z")

</div>

except

```auto

while (colors[maskedRND] == maskF) {
	var maskedRND = 1+random(5);
}

```

---

<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: [July 26, 2004, 9:36am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/13 "2004-07-26T09:36:18Z")

</div>

Ah yes, that’s to make sure that the masked movieclip doesn’t get the same colour as the mask. It basically checks if the colour associated with the random number is the same as the colour of the mask, and if so, change rnd to another random number until it isn’t the same.

---

<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: [July 26, 2004, 9:38am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/14 "2004-07-26T09:38:46Z")

</div>

ahhhh. you are a star. thanks heaps

---

<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: [July 26, 2004, 9:39am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/15 "2004-07-26T09:39:48Z")

</div>

No problem 🙂

---

<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: [July 27, 2004, 1:44am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/16 "2004-07-27T01:44:38Z")

</div>

Voetsjoeba,

I’m trying to convert the fla from yesterday to work on button click  
I.E…  
if the “blue” button is clicked the blue frame will wipe in over the current color. I think I’m getting there, but if you get online before I can post how far I get can you word me up on how to achieve this?

---

<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: [July 27, 2004, 2:07am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/17 "2004-07-27T02:07:57Z")

</div>

here’s what I got so far

The thing I can;t get working now is if the color is the same as the current then don’t play.

any help greatly appreciated

I couldn’t upload the file I had which had the bitmaps in place.  
In the bitmap version there is a flash of the color that is to be wiped in prior to the wipe beggining.

have included images too.

hope this makes sense as it’s the end of another long day and I am knackered

---

<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: [July 27, 2004, 4:47am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/18 "2004-07-27T04:47:22Z")

</div>

or anyone?

---

<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: [July 27, 2004, 8:27am UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/19 "2004-07-27T08:27:08Z")

</div>

What’s the problem ? I’m kinda confused by the file you attached.

---

<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: [July 27, 2004, 11:13pm UTC](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773/20 "2004-07-27T23:13:39Z")

</div>

sorry Voetsjoeba.

I’m trying to make the change (“wipe”) happen on mouse click (so if they click the green buttin, the green MC is wiped on) the file is confusing I guess because I don’t know what I’m really doing. 😃

[Next page](https://forum.kirupa.com/t/replacing-an-mc-which-is-masked/58773.md?page=2)
