PDA

View Full Version : combobox linking to swf files


awetch
04-07-2003, 11:10 PM
Thank you for reading this post, and for any help given!


I am using a combobox, but cannot find the correct code to do the following:

I would like the combobox to load an external swf file onto level 2 once the selection is clicked on in the combobox.

for example, if these were the combobox options
BOB
ED

i need BOB to load an swf file called BOB into level/layer 2

All i can do right now is link to an external url

any suggestions?>

bembino
04-23-2003, 07:16 AM
Place a combobox on frame 1 of the main timeline
Name it externalSWF_cb
Select frame 1 of the main timeline and open the Actions Panel
Type the following code:
// create array of label and data info for combobox
externalSWF_array = [ {label:"Fade JPG", data:"fadeJPG.swf"}, {label:"Load Big JPG", data:"loadBigJPG.swf"}];
// populate combobox with data from array
externalSWF_cb.setDataProvider(externalSWF_array);
// define changeHandler for combobox
function onExtSWFSelected(cb) {
loadMovieNum(cb.getSelectedItem().data, 2);
}
//assign changeHandler to combobox
externalSWF_cb.setChangeHandler("onExtSWFSelected");
Of course, you would change the externalSWF_array to match your file names.

awetch
04-23-2003, 06:39 PM
thank you for your reply, i will try this once i get a chance.
thanks again!