# \[MX\] Scripting UI components - NOT WORKING!

**URL:** <https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332>\
**Category:** flash\
**Created:** [November 18, 2002, 10:04pm UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332 "2002-11-18T22:04:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![morse](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@morse](https://forum.kirupa.com/u/morse)\
**Post date:** [November 18, 2002, 10:04pm UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/1 "2002-11-18T22:04:42Z")

</div>

The rundown:  
Ok here’s the deal. I hope that somebody knows how to script the new Flash UI components, because I don’t seem to be able to. I have a combobox with the instance name “box1” and a pushbutton with an instance name “play1”.

The problem:  
Each selection in “box1” has a scene I want to go to when “play1” is clicked. If the script below is added to “play1” and I run the movie, all the trace() commands work just fine, but the “\_root.gotoAndPlay(“scene whatever”, 1);” doesn’t work at all. (The trace() commands were added to see if my if(){} statements are working, and they appear to be).

In essence, I was hoping somebody could help me out. If you need a file attachment, I MAY be able to (not at home right now).

//Script for “play1”:  
// Code  
on (release) {  
if (\_root.box1.getSelectedIndex() == 0) {  
\_root.gotoAndPlay(“scene 0”, 1);  
trace(“scene 0, 1”);  
}  
if (\_root.box1.getSelectedIndex() == 1) {  
\_root.gotoAndPlay(“scene 1”, 1);  
trace(“scene 1, 1”);  
}  
if (\_root.box1.getSelectedIndex() == 2) {  
\_root.gotoAndPlay(“scene 2”, 1);  
trace(“scene 2, 1”);  
}  
if (\_root.box1.getSelectedIndex() == 3) {  
\_root.gotoAndPlay(“scene 3”, 1);  
trace(“scene 3, 1”);  
}  
if (\_root.box1.getSelectedIndex() == 4) {  
\_root.gotoAndPlay(“scene 4”, 1);  
trace(“scene 4, 1”);  
}  
if (\_root.box1.getSelectedIndex() == 5) {  
\_root.gotoAndPlay(“scene 5”, 1);  
trace(“scene 5, 1”);  
}  
}  
// End

_P.S. this does have formatting_

---

<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:** [November 19, 2002, 4:20am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/2 "2002-11-19T04:20:18Z")

</div>

1. Scenes are evil 😛

2. Is your combobox and actions on the \_root timeline (not in a movie clip)?

3. I may need to see a source.

---

<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:** [November 19, 2002, 4:37am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/3 "2002-11-19T04:37:08Z")

</div>

1. Scenes ARE evil. Should I use loadMovie or whatever it is? (never ever done this before)

2. Everything is in \_root.

3. I can post I guess… Say if you want it, but I would like only a minimal number of people w/ this file, until beta version is complete.

---

<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:** [November 19, 2002, 4:45am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/4 "2002-11-19T04:45:52Z")

</div>

You can post a link to it in a PM to me if you would like.

I don’t know much about the subject, but I can give it a whirl 🙂

---

<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:** [November 19, 2002, 4:55am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/5 "2002-11-19T04:55:23Z")

</div>

I’ll do that now…

---

<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:** [November 19, 2002, 10:22am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/6 "2002-11-19T10:22:33Z")

</div>

Did you try to use labels? It helps sometimes…

pom :asian:

---

<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:** [November 19, 2002, 10:28am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/7 "2002-11-19T10:28:08Z")

</div>

I got it Ilyas 🙂

The file was fixed and sent back 🙂

::SCORE!!!::

Morse wasn’t using a click handler on the button (component as well) to process the data so it wasn’t working.

---

<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:** [November 19, 2002, 10:32am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/8 "2002-11-19T10:32:32Z")

</div>

Oups. :x

---

<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:** [November 19, 2002, 10:33am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/9 "2002-11-19T10:33:30Z")

</div>

I learned it from your building a form with components tutorial 🙂

Thanks Ilyas, couldn’t have done it without you 🙂  
(as usual)

---

<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:** [November 19, 2002, 10:45am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/10 "2002-11-19T10:45:29Z")

</div>

Always a pleasure 😛

---

<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:** [November 19, 2002, 10:46am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/11 "2002-11-19T10:46:40Z")

</div>

I don’t know what I would do without you Ilyas 🙂

Seriously…lol.

---

<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:** [November 19, 2002, 10:50am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/12 "2002-11-19T10:50:45Z")

</div>

Hey, stop it, you’re scaring me, lost… 😛

---

<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:** [November 19, 2002, 6:33pm UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/13 "2002-11-19T18:33:18Z")

</div>

Yes!!!

I managed to scare both you and Phil in one night.

I think that is a new record for me. I wonder if I can scare more than that…hmmm.

I think Rev holds the record for scaring people though, when he had his GELF avatar and footer (if you saw that).

---

<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:** [November 20, 2002, 12:12am UTC](https://forum.kirupa.com/t/mx-scripting-ui-components-not-working/8332/14 "2002-11-20T00:12:45Z")

</div>

lol
