# Duplicating movie clip problem

**URL:** https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589
**Category:** Uncategorized
**Created:** [July 10, 2008, 3:18pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589 "2008-07-10T15:18:39Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Brian\_McGovern](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Brian\_McGovern](https://forum.kirupa.com/u/Brian_McGovern)
#### Post date: [July 10, 2008, 3:18pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/1 "2008-07-10T15:18:39Z")

</div>

Help Anybody,

I followed kirupa’s tutorial on duplicating movieclips [http://www.kirupa.com/developer/actionscript/duplicate.htm](http://www.kirupa.com/developer/actionscript/duplicate.htm)

Now I have to fade the object I am duplicating in the timeline. I thought placing a object over it as a layer would work…but it doesn’t.

Can anybody help?

Thank you, Brian

---

<div class="post-metadata">

### Author: ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)
#### Post date: [July 10, 2008, 3:43pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/2 "2008-07-10T15:43:02Z")

</div>

Have a play around with the alpha value of the duplicated clip…in the tutorial this is done automatically using a random value:  
this.\_alpha = random(100);

You’ll probably have to place the alpha code into the button handler and reference the previous duplicate. Something like this might work:

```auto
on (press) {
	i = i + 1;
	duplicateMovieClip(_root.circle, "circle" + i, i);
	_root["circle" + (i - 1)]._alpha = 10;
}

```

---

<div class="post-metadata">

### Author: ![Brian\_McGovern](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Brian\_McGovern](https://forum.kirupa.com/u/Brian_McGovern)
#### Post date: [July 10, 2008, 4:06pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/3 "2008-07-10T16:06:34Z")

</div>

Im sorry, i forgot im not using a button, do I just write a frame script to make the the clip disappear?

---

<div class="post-metadata">

### Author: ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)
#### Post date: [July 10, 2008, 4:33pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/4 "2008-07-10T16:33:07Z")

</div>

Sure…you could address the mc directly using the \_alpha or \_visible properties, e.g.

mc\_I\_want\_to\_vanish.\_visible = “false”;

or

mc\_I\_want\_to\_vanish.\_alpha = xxx;

where xxx is a value between 0 and 100.

---

<div class="post-metadata">

### Author: ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)
#### Post date: [July 10, 2008, 4:35pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/5 "2008-07-10T16:35:07Z")

</div>

Your query is very vague though :x

---

<div class="post-metadata">

### Author: ![Brian\_McGovern](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Brian\_McGovern](https://forum.kirupa.com/u/Brian_McGovern)
#### Post date: [July 10, 2008, 4:48pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/6 "2008-07-10T16:48:53Z")

</div>

don’t know why but neither works.  
thanks anyways

---

<div class="post-metadata">

### Author: ![Brian\_McGovern](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Brian\_McGovern](https://forum.kirupa.com/u/Brian_McGovern)
#### Post date: [July 10, 2008, 5:22pm UTC](https://forum.kirupa.com/t/duplicating-movie-clip-problem/265589/7 "2008-07-10T17:22:09Z")

</div>

i figured it out.

onClipEvent (load) {  
scale = (random(100)+50);

```
this._x = 522;
this._y = random(50);
this._alpha = random(100);
this._xscale = scale;
this._yscale = scale;

```

}

onClipEvent(enterFrame){

this.\_alpha-=.5;  
if (this.\_alpha\<=0){  
}

}
