PDA

View Full Version : ComboBox Q



fatnslow
July 22nd, 2004, 08:12 AM
Hey, I wonderd if it was possible to do so when clicking on one of the options in the ComboBox, it could load an .swf into an container?

Maybe with:
Code:
container.loadMovie("sound.swf");

Or something...

Thanks,
fatnslow

fatnslow
July 23rd, 2004, 07:22 AM
Anyone?

ScriptFlipper
July 23rd, 2004, 07:49 AM
if you're using mx2004, this is the way to go:
use this code on your combobox:

on (change) {
_root.container.loadMovie(this.value);
}

I assume you store the swf names as values in the combobox.

fatnslow
July 23rd, 2004, 11:55 AM
Thanks, im actually at mx, but it looks correct, else I will try some more onchange stuff

fatnslow
July 23rd, 2004, 12:41 PM
Hmm didnt work, said it was a wrong on command or somthing...

natronp
July 23rd, 2004, 12:42 PM
i think you need a change handler....

ScriptFlipper
July 23rd, 2004, 12:50 PM
on (change) won't work for mx components
I don't know what will, you'll ahve to look it up in the components dictionary

fatnslow
July 23rd, 2004, 12:59 PM
Cant find it there. Could anyone with mx help me here?
I could also use a GO button, first use the combobox to get the correct label, and then press a GO button, wich loads it. But im not good at As, so could anyone help?

Thanks,
fatnslow

fatnslow
July 24th, 2004, 08:40 AM
Anyone with mx able to help?

tranism
July 24th, 2004, 07:20 PM
for mx2004, you no longer use change handlers, but listeners. Look up component listeners in the help section of the program...it expains it all. :)

2nd day
July 25th, 2004, 07:12 AM
fla is coming up :D
or if anybody else is kind enough the code is in the Flash MX forum... same topic