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:
blank movieclip with the instance name of “blank”
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…
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…
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…