dopefries
03-08-2007, 01:30 PM
Hi there,
I've just finished a tutorial on the Flash combobox. Very nice. However, I'm having problems returning the selected value from the combobox.
myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();
};
myData.load("http://127.0.0.1/transport/ADDROUTE/getroute.php");
placeTheDataIntoTheRightPlace = function(){
for (var i = 0; i<myData.n; i++) {
myComboBox.addItemAt(i,myData.comboData1);
}
};
function showSelected(){
help = myComboBox.selectedItem.toString();
trace(help);
};
myComboBox.addEventListener("change", showSelected);
The PHP
<?php
$dataForCombobox_1 = "This is our FIRST variable, get ready combobox here I come";
$dataForCombobox_2 = "This is our SECOND variable, get ready combobox here I come";
print("&comboData1=$dataForCombobox_1");
print("&comboData2=$dataForCombobox_2");
?>
My first problem is changing comboData1 to fit the loop - comboData+i. I cant make this work properly.
My second problem is that when returning the results from the combobox, all I get is [object Object]. Damn annoying and I cant figure this out.
I hope you can shed some light on my little problem.
Thanks in advance
Dave
I've just finished a tutorial on the Flash combobox. Very nice. However, I'm having problems returning the selected value from the combobox.
myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();
};
myData.load("http://127.0.0.1/transport/ADDROUTE/getroute.php");
placeTheDataIntoTheRightPlace = function(){
for (var i = 0; i<myData.n; i++) {
myComboBox.addItemAt(i,myData.comboData1);
}
};
function showSelected(){
help = myComboBox.selectedItem.toString();
trace(help);
};
myComboBox.addEventListener("change", showSelected);
The PHP
<?php
$dataForCombobox_1 = "This is our FIRST variable, get ready combobox here I come";
$dataForCombobox_2 = "This is our SECOND variable, get ready combobox here I come";
print("&comboData1=$dataForCombobox_1");
print("&comboData2=$dataForCombobox_2");
?>
My first problem is changing comboData1 to fit the loop - comboData+i. I cant make this work properly.
My second problem is that when returning the results from the combobox, all I get is [object Object]. Damn annoying and I cant figure this out.
I hope you can shed some light on my little problem.
Thanks in advance
Dave