Problem loading external swf's via combo box values

I’m trying to load some external swf’s based upon a combo box selection and it’s not working.

Here is what I have setup so far:

2 layers. 1 frame.

1st layer is for my main script:
function loadMovieClip () {
if (_root.color_combo.getValue() == Purple) {
_root.blank.loadMovie(“earrings/earring_00001.swf”, 1);
} else if (_root.color_combo.getValue() == Green) {
_root.blank.loadMovie(“earrings/earring_00002.swf”, 1);
}
}

2nd layer has two things:

  1. blank movieclip with the instance name of “blank”
  2. combo box with the following values: (Blue,Yellow,Green,Red,Purple) and instance name of “color_combo”. Also the combo box has the following script:

on (release) {
_root.color_combo.setChangeHandler(“loadMovieClip”);
}

This project is one directory up from the directory where the files I am trying to load are located. (…/ProjectDirectory/earrings/…) So I think I have that setup right.

When I test the movie there are no errors but selecting either “Green” or “Purple” has no effect. Nothing happens. I am wondering why…

Any help would be appreciated.
Thanks.

Howdy…

There are two things I visibly see which are not correctly coded…

if (_root.color_combo.getValue() == Purple) {

getValue() function returns a text string and you are comparing it with some undefined variable right now… You will need double quotes to compare with the string…

_root.blank.loadMovie(“earrings/earring_00002.swf”, 1);

movieclip.loadMovie() function doesn’t take the second argument that way… I think you are confused with loadMovieNum() function right now… Get rid of the second argument…

See if that clears some hot air out and let me know…

Thanks for replying.

I got it to work!!!

All I had to do was place quotation marks around my getValue() items like this:

if (_root.color_combo.getValue() == “Purple”) {

And then on the combo box place quotation marks around the function I am calling when released like this:

on (release) {
_root.color_combo.setChangeHandler(“loadMovieClip”);
}

This will be very useful because instead of implementing this within one movie I can call external swf’s which will greatly reduce file size overall.

Thanks again!

No problem… :slight_smile: