# Rollover

**URL:** <https://forum.kirupa.com/t/rollover/26601>\
**Category:** Uncategorized\
**Created:** [July 24, 2003, 4:29pm UTC](https://forum.kirupa.com/t/rollover/26601 "2003-07-24T16:29:16Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)\
**Post date:** [July 24, 2003, 4:29pm UTC](https://forum.kirupa.com/t/rollover/26601/1 "2003-07-24T16:29:16Z")

</div>

I have a problem, the problem is, that i want a movie to show when i rollover a button, but i want it to be invisible if the user does not rollover the button, how would i go about doing 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 24, 2003, 4:55pm UTC](https://forum.kirupa.com/t/rollover/26601/2 "2003-07-24T16:55:20Z")

</div>

[http://www.kirupa.com/developer/flash5/animatedrollover.htm](http://www.kirupa.com/developer/flash5/animatedrollover.htm)  
(-:

---

<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 24, 2003, 4:59pm UTC](https://forum.kirupa.com/t/rollover/26601/3 "2003-07-24T16:59:53Z")

</div>

that doesn’t 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 24, 2003, 5:02pm UTC](https://forum.kirupa.com/t/rollover/26601/4 "2003-07-24T17:02:31Z")

</div>

[http://www.kirupa.com/developer/flash5/advroll.htm](http://www.kirupa.com/developer/flash5/advroll.htm)

But since tellTarget is deprecated and replaced with the much easier dot syntax, change this… [AS]on (rollOver) {  
tellTarget ("/rollover") {  
gotoAndPlay (“1text”);  
}  
}  
on (rollOut) {  
tellTarget ("/rollover") {  
gotoAndPlay (“1back”);  
}  
}[/AS]

To this…  
[AS]on (rollOver) {  
rollover.gotoAndPlay(“1text”);  
}  
on (rollOut) {  
rollover.gotoAndPlay(“1back”);  
}[/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:** [July 24, 2003, 5:10pm UTC](https://forum.kirupa.com/t/rollover/26601/5 "2003-07-24T17:10:06Z")

</div>

this is what i want, i have a set of buttons at the side, and when i roll over this button, i want a movie clip to start playing, but if i don’t rollover it, i want it to appear invisible. I have put the movie clip on stage and i have given it the instance name minigoals, now obviously i would have to put some action script in the button that controls it, what should i put in?

---

<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 24, 2003, 5:13pm UTC](https://forum.kirupa.com/t/rollover/26601/6 "2003-07-24T17:13:31Z")

</div>

Okay, if the animation loops continuously (sp?) then you can do something like this: Say your movieClip with the animation is called, um, ‘doggie’ - I hate making up instance names…  
[AS]  
//on your button  
on(rollOver){  
\_root.doggie.\_visible=true;  
}  
on(rollOut){  
\_root.doggie.\_visible=false;  
}  
[/AS]  
Don’t forget to put the code on the movieClip ‘doggie’ as well so it doesn’t show up at start up:  
[AS]  
//on the movieClip doggie  
onClipEvent(load){  
this.\_visible=false;  
}  
[/AS]

That’ll do it?

---

<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 24, 2003, 5:15pm UTC](https://forum.kirupa.com/t/rollover/26601/7 "2003-07-24T17:15:01Z")

</div>

refer to last post :sigh:

You would need to target the clip and tell it to gotoAndPlay() what you want, just like stated in the tutorial in my last post.

If you want it to be invisible to start with, make the first frame of the movie clip empty and containing a stop() action, so when the movie loads it will start off stopped at the empty frame until you tell it to play on rollover with the method in my last post.

---

<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 24, 2003, 5:22pm UTC](https://forum.kirupa.com/t/rollover/26601/8 "2003-07-24T17:22:31Z")

</div>

Freddy that works okay, but the problem is that my movie clip does not loop. When i roll over the button, it just displays a the movie in its last frame how could i get around 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 24, 2003, 5:31pm UTC](https://forum.kirupa.com/t/rollover/26601/9 "2003-07-24T17:31:07Z")

</div>

Hey lostinbeta, u put 1back, in ur actionscript, is that just a made up instance name , should i replace whats in the speachmarks with the instance name for my movie clip?

---

<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 24, 2003, 5:41pm UTC](https://forum.kirupa.com/t/rollover/26601/10 "2003-07-24T17:41:27Z")

</div>

I edited the code from the tutorial, in the tutorial, 1back was a frame label within the movie clip symbol you wanted to play.

---

<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 24, 2003, 5:45pm UTC](https://forum.kirupa.com/t/rollover/26601/11 "2003-07-24T17:45:05Z")

</div>

Hi lostinbeta, wouldn’t i need to put an instance name of my movie clip simple in the actionscrip

on (rollOver) {  
rollover.gotoAndPlay(“1text”);  
}  
on (rollOut) {  
rollover.gotoAndPlay(“1back”);  
}

there is no mention here of instance name of a movie clip, should i put it in or not? or should i just change the 1text and 1back, to numbers and put it in my button script!

---

<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 24, 2003, 5:49pm UTC](https://forum.kirupa.com/t/rollover/26601/12 "2003-07-24T17:49:18Z")

</div>

rollover is the instance name (again… all covered in that tutorial link)

---

<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 24, 2003, 5:50pm UTC](https://forum.kirupa.com/t/rollover/26601/13 "2003-07-24T17:50:21Z")

</div>

If “back1” is a frame label then you need to replace it with the correct frame number from your movie… unless you are also naming your frames.

HTH  
Liz

---

<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 24, 2003, 5:52pm UTC](https://forum.kirupa.com/t/rollover/26601/14 "2003-07-24T17:52:26Z")

</div>

They’d understand better if you could post the .fla as well as I ^^

---

<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 24, 2003, 6:40pm UTC](https://forum.kirupa.com/t/rollover/26601/15 "2003-07-24T18:40:34Z")

</div>

Hey lostinbeta thanks a lot man, that worked a treat, i still think ur the best at flash, thanks for ur patience too, your a good guy!!
