Hi there!
Is it possible to make multiple selections in a ComboBox ?
i.e. make n consecutive selections and store them in an array
or make n selections in the open list of the CB by using (for example) the click-Shift Key keystroke
Purpose is to allow the user to select multiple different issues of a magazine with a maximum ease of use…
(Code I use is attached below)
Many thanks for your help!
Best regards,
Gerry
//import mx.controls.ComboBox; // imported in Parameters --> first frame
//----------------
CBBUY.addItem("Choose your issues...", "");
var myMainIssues = new LoadVars();
myMainIssues.onLoad = function() {
issues_array = this.myissues.split(";");
issuesdata_array = this.myissuesdata.split(",");
for (i = 0; i < issues_array.length; i++) {
CBBUY.addItem(issues_array*, issuesdata_array*);
}
};
myMainIssues.load("Issues/issues.txt");
var CBBUYListener:Object = new Object();
CBBUYListener.change = function(evt:Object) {
// This will ouput the label of the selected item
var mainissues = new LoadVars();
mainissues = evt.target.selectedItem.label;
if (mainissues != "") {
// HERE I NEED TO PUSH EACH SELECTION TO A NEW ARRAY
// FOR STORING A LIST OF THE LABELS OF THE SELECTED ISSUES
// (LIST WHICH I CAN DISPLAY LATER IN ORDER SUMMARY
// AND USE AS A RECAP IN THE BILL)
trace(mainissues); // ??
}
// This will ouput the data of the selected item
var mainissuesData = new LoadVars();
mainissuesData = evt.target.selectedItem.data;
if (mainissuesData != "") {
// HERE I NEED TO PUSH EACH SELECTION TO A NEW ARRAY
// FOR STORING THE DATA OF THE SELECTED ISSUES
// (LIST WHICH I CAN USE LATER FOR COMPUTING THE AMOUNT
// OF THE PURCHASE)
trace(mainissuesData); // ??
}
};
CBBUY.addEventListener("change", CBBUYListener);