# Button actions problem

**URL:** <https://forum.kirupa.com/t/button-actions-problem/15476>\
**Category:** Uncategorized\
**Created:** [March 14, 2003, 5:37pm UTC](https://forum.kirupa.com/t/button-actions-problem/15476 "2003-03-14T17:37:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![powder](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@powder](https://forum.kirupa.com/u/powder)\
**Post date:** [March 14, 2003, 5:37pm UTC](https://forum.kirupa.com/t/button-actions-problem/15476/1 "2003-03-14T17:37:46Z")

</div>

Hello, I am having a bit of trouble here, I have this action on my buttons:

on (press) {  
\_root.nPage = “company”;  
AnimationMC.play();  
}  
on (press) {  
gotoAndPlay(3);  
}

I am trying to have a button change frames on the main timeline (gotoAndPlay X) and also load a MC on the same click.  
However I suck at actionscripting and I can’t figure this out. I think what is happening is because the on(press) is separate it is causing my pages to load at different times when I click real fast when AnimationMC is playing. However if I wait for the animation to load first it works %99 of the time.

Anyway this is causing conflicts, I hope this makes sense is there a way to combine the 2 to say

on press play this movie and also goto frame 3 ???

or a better idea??

Thanx for you help…

see ya

---

<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:** [March 14, 2003, 5:52pm UTC](https://forum.kirupa.com/t/button-actions-problem/15476/2 "2003-03-14T17:52:26Z")

</div>

Try this:[AS]on (press) {  
gotoAndPlay(3);  
\_root.nPage = “company”;  
\_root.AnimationMC.play();  
}  
[/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:** [March 17, 2003, 4:10am UTC](https://forum.kirupa.com/t/button-actions-problem/15476/3 "2003-03-17T04:10:36Z")

</div>

Hey electrongeek, sorry about taking so long to reply to your reply…🙂 But thanx alot for your help, What you told me does work, and your way is much cleaner too…😉 but however there is still the same problem.

I set up this site I am building kinda stupid…I think. The only reason I need the frames to change on the main timeline is to change the downstate appearance of the buttons.

flash buttons only have up, over , down but no hold down until next button is pressed frame. which would be nice.

-On my main timeline I have my navigation of 6 buttons.

- I then have a stop action on each keyframe and on each of these frames I have changes made to each individual button within the complete nav bar ( to appear as pressed and in waiting for next selection mode.)

Basically to achieve the effect that when you press “about” it holds down until the next button is pressed. Which then appears to be holding down. I was trying to do this by having it jump to the appropriate keyframes on the main timeline.

I am sure some simple actionscripting would do the trick much easier…

Sorry for just rambling, just something I am trying to figure out and I think it is a little to late in the game to make any major changes.

See ya…

---

<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:** [March 17, 2003, 4:34am UTC](https://forum.kirupa.com/t/button-actions-problem/15476/4 "2003-03-17T04:34:24Z")

</div>

You’re in luck, I have a sample file of something similar to what you want, it will give you an idea as to how to set up that effect. =)

---

<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:** [March 17, 2003, 4:36am UTC](https://forum.kirupa.com/t/button-actions-problem/15476/5 "2003-03-17T04:36:36Z")

</div>

Electrongeek, is there anything you can’t answer…thanx so much I will look through it…🙂
