PDA

View Full Version : [MX] Scripting UI components - NOT WORKING!



morse
November 18th, 2002, 05:04 PM
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

lostinbeta
November 18th, 2002, 11:20 PM
1) Scenes are evil :P

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

3) I may need to see a source.

morse
November 18th, 2002, 11:37 PM
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.

lostinbeta
November 18th, 2002, 11:45 PM
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 :)

morse
November 18th, 2002, 11:55 PM
I'll do that now...

pom
November 19th, 2002, 05:22 AM
Did you try to use labels? It helps sometimes...

pom :asian:

lostinbeta
November 19th, 2002, 05:28 AM
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.

pom
November 19th, 2002, 05:32 AM
Oups. :x

lostinbeta
November 19th, 2002, 05:33 AM
I learned it from your building a form with components tutorial :)

Thanks Ilyas, couldn't have done it without you :)
(as usual)

pom
November 19th, 2002, 05:45 AM
Always a pleasure :P

lostinbeta
November 19th, 2002, 05:46 AM
I don't know what I would do without you Ilyas :)

Seriously...lol.

pom
November 19th, 2002, 05:50 AM
Hey, stop it, you're scaring me, lost... :P

lostinbeta
November 19th, 2002, 01:33 PM
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).

morse
November 19th, 2002, 07:12 PM
lol