# Quick Script Question

**URL:** <https://forum.kirupa.com/t/quick-script-question/106637>\
**Category:** Uncategorized\
**Created:** [April 7, 2004, 3:02pm UTC](https://forum.kirupa.com/t/quick-script-question/106637 "2004-04-07T15:02:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jezthomp](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jezthomp](https://forum.kirupa.com/u/Jezthomp)\
**Post date:** [April 7, 2004, 3:02pm UTC](https://forum.kirupa.com/t/quick-script-question/106637/1 "2004-04-07T15:02:35Z")

</div>

I have the following script on a button. Which tells it once pressed to go to a frame label and play an animation.

The problem being whenever i roll out it plays the animation which i have done to do when the mouse rolls out the roll out. This is fine when you dont click the button. However, when you do click the button it plays the right animation untill you roll out it goes back to the roll out animation instead of the mouse press animation i want it to go.☹

on (rollOver) {  
gotoAndPlay(“wedding\_camstart”);  
}

on (rollOut) {  
gotoAndPlay(“wedding\_camfinish”);  
}

on (press) {  
gotoAndPlay(“camera\_away”);  
}

Any ideas?

---

<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:** [April 7, 2004, 8:04pm UTC](https://forum.kirupa.com/t/quick-script-question/106637/2 "2004-04-07T20:04:59Z")

</div>

Put the fla & swf. in a zip and post it  
maybee

---

<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:** [April 7, 2004, 9:40pm UTC](https://forum.kirupa.com/t/quick-script-question/106637/3 "2004-04-07T21:40:33Z")

</div>

have uploaded so you can see 🙂

---

<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:** [April 8, 2004, 10:21am UTC](https://forum.kirupa.com/t/quick-script-question/106637/4 "2004-04-08T10:21:48Z")

</div>

Someone must have a suggestion?☹

How about this. Is there anyway of saying onRoll out goto play the rollOut animation(framelabel). UNLESS pressed goto pressed button animation(framelabel)?

I’m sure that can be done can it not?

---

<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:** [April 8, 2004, 9:09pm UTC](https://forum.kirupa.com/t/quick-script-question/106637/5 "2004-04-08T21:09:05Z")

</div>

Here is alittle more detail so hope someone can help.

Basicly its fine when you roll over plays animation(framelabel) and rolls out plays animation (framelabel) fine. However when i click the button it plays the next animation framelabel which is the start of a new page fine.

However once i rollout again it goes back and plays the roll out animation and put me back where i started. Basicly i need to tell it roll out unless pressed; if pressed go to the pressed button animation(framelabel) and once you have pressed and rolled out it doesnt play the roll out again. Hope that makes sense.

I’ve put this script together with some help from other people.

on (rollOver) {  
if (!pressed) {  
gotoAndPlay(“wedding\_camstart”);  
} else {  
gotoAndPlay(“camera\_away”);  
}  
}  
on (rollOut) {  
if (!pressed) {  
gotoAndPlay(“wedding\_camfinish”);  
} else {  
gotoAndPlay(“camera\_away”);  
}  
}  
on (release) {  
pressed = true;  
gotoAndPlay(“camera\_away”);

That works however, when you rollover or press it from then on it just plays camera away all the time and you cannot got back to the original, rollover button if you get what i mean.
