# \[FMX\] loops with attached movie for fade out effect

**URL:** https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882
**Category:** flash
**Created:** [July 27, 2003, 9:26pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882 "2003-07-27T21:26:08Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![planetfour](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@planetfour](https://forum.kirupa.com/u/planetfour)
#### Post date: [July 27, 2003, 9:26pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/1 "2003-07-27T21:26:08Z")

</div>

Hey wonderful helpers in the kirupa world… :beam:

I’m trying to achieve an effect such that when a user rolls over a movie clip, a new movie clip appears, enlarges and fades out over the original. Sorry no example, i just cooked it up in my head.

I’ve managed to attach a movieclip to the main stage, but I can’t get it to ripple out, so to speak, like I wanted to.

I’ve been trying to do it by altering the height, with, and alpha with a loop, but something’s just not right. The following code is attached to the movie clip I want this to happen for. New to AS, be gentle!!😛

[AS]on (rollOver) {  
\_root.attachMovie (“aaronName”,“aaronClone”,1);

```
aaronClone._x = aaronName._x;
aaronClone._y = aaronName._y;

for (var i = 1; i &lt;= 6; i++) {
	aaronClone._height = aaronClone._height * (i*(.1));
	aaronClone._width = aaronClone._width * (i*(.1));
	aaronClone._alpha = aaronClone._alpha - (i*(15));
}

```

}[/AS]

can anyone lend a hand?

---

<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, 2003, 11:46pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/2 "2003-07-27T23:46:39Z")

</div>

for loops execute in 1 frame. If you want to see the fade, you’ll have to change your \_height, \_width and \_alpha over a few frames, with a onEnterFrame handler for instance.

pom 🙂

---

<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 29, 2003, 2:52am UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/3 "2003-07-29T02:52:19Z")

</div>

OK, I got it to work with the following code (thanks for the tip!😏 )  
[AS]on (rollOver) {  
attachMovie (“aaronName”,“aaronClone”,1);

```
    aaronClone._x = aaronName._x;
    aaronClone._y = aaronName._y;

```

}

onClipEvent (enterFrame) {  
aaronClone.\_height = (aaronClone.\_height \* 1.1);  
aaronClone.\_width = (aaronClone.\_width \* (1.1));  
aaronClone.\_alpha = (aaronClone.\_alpha - (15));  
if (this.aaronClone.\_alpha \< 10) {  
this.aaronClone.removeMovieClip;  
}  
}  
on (rollOut) {  
delete (this.aaronClone);  
}  
[/AS]

Now when I roll over I get the desired effect. However, if I then roll out of the movie, then rollback into it, the loop just starts repeating. I’m thinking I’m not using remove and/or delete in the right context or the right way?

The code is on a movie clip on the main timeline, which lasts for about 6 frames.

Any help? I’m learning!!

---

<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 29, 2003, 11:45pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/4 "2003-07-29T23:45:32Z")

</div>

OK, got it to work with the following code (darn parens and ==!),

```auto
on (rollOver) {
        attachMovie ("aaronName","aaronClone",0);
        
        aaronClone._x = aaronName._x;
        aaronClone._y = aaronName._y;
}

	
onClipEvent (enterFrame) {
                aaronClone._height = (aaronClone._height * 1.1);
                aaronClone._width = (aaronClone._width * (1.1));
                aaronClone._alpha = (aaronClone._alpha - 15);
        if (this.aaronClone._alpha == 10) {
				this.aaronClone.removeMovieClip();
				}
			}
on (rollOut) {
	this.aaronClone.removeMovieClip();
}

```

but now a couple more questions… I’d like the effect to repeat for the duration of the mouseover, any way to do this? Also, if I remain over the clip until the “clone” is removed, my cursor remains a hand instead of turning back into a pointer! Help a novice out!!

---

<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 31, 2003, 3:41am UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/5 "2003-07-31T03:41:11Z")

</div>

sorry to gratuitously bump… can anyone help me understand how to use the onRollOver correctly?

Hope I didn’t post in the wrong forum… if so, mods, lemme know or move…

Thanks!!

---

<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 31, 2003, 3:54am UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/6 "2003-07-31T03:54:20Z")

</div>

Not sure if this is what you’re looking for, but you might give it a try. I also simplified the enterframe alterations using \*= and -=. These just say, “aaronClone.\_yscale \*=1.1;” take aaronClone’s yscale and multiply it by 1.1.

```auto
on (rollOver) {
        attachMovie ("aaronName","aaronClone",0);
        
        aaronClone._x = aaronName._x;
        aaronClone._y = aaronName._y;
}

onClipEvent (enterFrame) {
        aaronClone._yscale *=1.1;
        aaronClone._xscale *= 1.1;
        aaronClone._alpha -=15);
        if (this.aaronClone._alpha == 10) {
                this.aaronClone._alpha=100;
                this.aaronClone._yscale=100;
                this.aaronClone._xscale=100;
        }
}
on (rollOut) {
        this.aaronClone.removeMovieClip();
}

```

---

<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 31, 2003, 2:01pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/7 "2003-07-31T14:01:04Z")

</div>

Now that’s some thinkin… woulda never thought of just overlaying the attached mc. Not at home right now, but I’ll try that tonight!

Thanks!:goatee:

---

<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: [August 1, 2003, 6:14pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/8 "2003-08-01T18:14:51Z")

</div>

OK, that’s a cleaner approach I think, but in Control Test movie, if I’ve seen one whole cycle of the code (make sense? alpha gets all the way to 10, and the mc is rescaled…) then when I rollout of the mc, the mouse doesn’t change back to a pointer, it’s a finger still. until I roll out of the stage altogether and roll back in.

Any help in that area? Sound familiar? Forever in debt to kirupa once again.

---

<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: [August 4, 2003, 7:33pm UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/9 "2003-08-04T19:33:21Z")

</div>

has anyone ever experienced anything like 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: [August 15, 2003, 3:17am UTC](https://forum.kirupa.com/t/fmx-loops-with-attached-movie-for-fade-out-effect/26882/10 "2003-08-15T03:17:20Z")

</div>

> \*Originally posted by planetfour \*  
> \*\*OK, that’s a cleaner approach I think, but in Control Test movie, if I’ve seen one whole cycle of the code (make sense? alpha gets all the way to 10, and the mc is rescaled…) then when I rollout of the mc, the mouse doesn’t change back to a pointer, it’s a finger still. until I roll out of the stage altogether and roll back in.  
> \*\*

Sorry to bring back the dead here, (especially after my own repeated bumps and all:smirk: ) but I’ve picked up this project again, and can’t seem to figure out why the above occurs. I figured I’d throw up a quick fla for anyone who could possibly assist.

Still an actionscript newb, so can someone explain why I can’t get rid of the finger? Perhaps I should just change it to a pointer at all times?

Edit: whoops, guess that fla was too big, and for some reason it the board only lets me post gifs and jpgs. so… guess this really is a gratuitouis bump.
