# What is wrong with this button code? (short)

**URL:** <https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480>\
**Category:** Uncategorized\
**Created:** [April 17, 2003, 2:16am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480 "2003-04-17T02:16:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevp](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kevp](https://forum.kirupa.com/u/kevp)\
**Post date:** [April 17, 2003, 2:16am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/1 "2003-04-17T02:16:35Z")

</div>

I’ve got a series of buttons that i’ve attached movies of moving words for the the rollover and rollout, and they work fine, but if i add any more ‘on’ handlers it just ignores it. Here’s the code:

[AS] on (rollOver) {  
\_root.empty\_main\_button.attachMovie(“resume\_button\_rollover”, “resume\_main\_over”, 0);  
}  
on (rollOut) {  
\_root.empty\_main\_button.attachMovie(“resume\_button\_rollout”, “resume\_main\_out”, 0);  
}  
on (release) {  
gotoAndPlay(“resume”, 1);  
}  
[/AS]

like i said, the rollover and outs work great, but the button doesn’t goto and play where i want it to, it just restarts the main movie.

---

<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 17, 2003, 3:01am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/2 "2003-04-17T03:01:17Z")

</div>

Using scenes huh?

not many of us do anymore. It seems like Flash really doesn’t like going to scenes… but it might just be a slight error. I assume that “resume” is a scene in the main timeline. As such I would suggest first, changing the script on the release to

\_root.gotoAndPlay(“resume”);

if that doesn’t work… try setting a frame label to “resume” at the point where you want it to go.

Frame labels work much better than scene labels.

---

<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 17, 2003, 7:10pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/3 "2003-04-17T19:10:09Z")

</div>

david,

thanks for the response. I am using scenes, this is just a simple little flash presentation i’m putting on cd showcasing my architecture studio projects. I wanted the projector to be one file so it is as idiot proof as possible, so the old architects i’m handing the cd out to wouldn’t have a problem. Is there a way to reference in all the different .swf’s, but then make the projector one file with them all embedded?

also, i tried the \_root.gotoandplay(“resume”); and it didn’t work

but of course it works excellent if i make that scene resume.swf and \_root.loadmovie, but now i’ve got multiple files… it’s still doable that way, but if i could have used the scenes, it would have been convenient.

---

<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 17, 2003, 8:39pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/4 "2003-04-17T20:39:11Z")

</div>

The fla would be helpfull

---

<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 17, 2003, 10:51pm UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/5 "2003-04-17T22:51:24Z")

</div>

eh…  
I’m an architect by trade, and have only had access to flash for like a month, so i hate posting this hackjob to some pros… haha, but anyways. I’ve made changes to it, and don’t want to hack it down to get it small enough to attach, so here it is on some webspace:

[kevp’s example for kirupa](http://www.shackspace.com/~kevp@shackmail.com/kevpkirupa.fla)

originally i had scene ‘main’ and others (‘resume’ ‘works’ etc). And when i attached the rollover and rollout movies to a button, the link to move to the next scene wouldn’t work anylonger. So as a temporary answer, I’ve redid it so that there are little clips in my library and I attachMovie to empty clips existing in ‘main’… It still allows me to keep it to one file for ease of making a projector, but am i limiting myself by doing it this way?

while we’re at it, i’ve made it so that when a user clicks on a button, this orange panel drops down. How do i make it so that when the user clicks on another button the existing panel retracks away, and _then_ the new panel drops down? it would really add to the seamlessness of the presentation…

[edit] btw, the file is 340k so sorry for the modem users [/edit]

---

<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 18, 2003, 12:14am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/6 "2003-04-18T00:14:03Z")

</div>

Flash likes going to scenes, it just wont go to the scene and play it. It always stops. That can be kind of annoying.

---

<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 18, 2003, 7:01am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/7 "2003-04-18T07:01:05Z")

</div>

I’ll take a look at the example when I get a chance Kepv.

Iammontoya… is that what’s wrong with the scene thing? I never really knew. I avoid multiple scenes like the pleague 😛

---

<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 18, 2003, 11:28am UTC](https://forum.kirupa.com/t/what-is-wrong-with-this-button-code-short/18480/8 "2003-04-18T11:28:03Z")

</div>

ya, i’ve done some basic little presentations before using all kinds of scenes and have never had a problem previously. This was all before i’d learned to attachmovie’s and using little things like rollovers and rollouts. Now i’d like to have my cake and eat it too 🙂
