abbyworld
05-16-2007, 04:38 AM
Hello,
I've created a grade viewer, where a user selects an ID number from the ComboBox, and their information (name, class name, score, grade) displays in a series of TextInputs. The data that goes in the ComboBox and the TextInputs comes from a .csv (comma separated values) file. It's working fine, except for one thing: the ComboBox only displays one of the ID numbers, but the others are invisible. If one of the "invisible" values is chosen from the ComboBox, the information displays normally in the TextInputs! I can't figure out why this is happening. I'm not too experienced with Flash Components or using external data, so please forgive me if you consider this a stupid question. My ActionScript is enclosed.
Thanks,
aj
var line:Array;
var loader_lv:LoadVars = new LoadVars( );
loader_lv.onData = function(d:String)
{
var i:Number;
var file:String;
var fields:Array;
file = d;
line = file.split(";");
for(i = 0; i < line.length; i++)
{
fields = line[i].split(",");
IDNo_cbo.addItem(fields[0]);
}
}
loader_lv.load("ClassRoster.csv");
function change(e:Object)
{
var index:Number;
var fields:Array;
index = e.target.selectedIndex;
fields = line[index].split(",");
LastName_txt.text = fields[1];
FirstName_txt.text = fields[2];
Dept_txt.text = fields[3];
ClassNo_txt.text = fields[4];
ClassTitle_txt.text = fields[5];
Instructor_txt.text = fields[6];
Score_txt.text = fields[7];
Grade_txt.text = fields[8];
}
IDNo_cbo.addEventListener("change", this);
// ActionScript that creates a white border around the grade viewer.
this.createEmptyMovieClip("border_mc", 1);
border_mc.lineStyle(2,0xFFFFFF,100);
border_mc.moveTo(20,20);
border_mc.lineTo(480,20);
border_mc.lineTo(20,20);
border_mc.lineTo(20,380);
border_mc.lineTo(480,380);
border_mc.lineTo(480,20);
if (_global.styles.Label == undefined) {
_global.styles.Label = new mx.styles.CSSStyleDeclaration();
}
_global.styles.Label.setStyle("color", 0xFFFFFF);
_global.styles.Label.setStyle("fontWeight", "bold");
I've created a grade viewer, where a user selects an ID number from the ComboBox, and their information (name, class name, score, grade) displays in a series of TextInputs. The data that goes in the ComboBox and the TextInputs comes from a .csv (comma separated values) file. It's working fine, except for one thing: the ComboBox only displays one of the ID numbers, but the others are invisible. If one of the "invisible" values is chosen from the ComboBox, the information displays normally in the TextInputs! I can't figure out why this is happening. I'm not too experienced with Flash Components or using external data, so please forgive me if you consider this a stupid question. My ActionScript is enclosed.
Thanks,
aj
var line:Array;
var loader_lv:LoadVars = new LoadVars( );
loader_lv.onData = function(d:String)
{
var i:Number;
var file:String;
var fields:Array;
file = d;
line = file.split(";");
for(i = 0; i < line.length; i++)
{
fields = line[i].split(",");
IDNo_cbo.addItem(fields[0]);
}
}
loader_lv.load("ClassRoster.csv");
function change(e:Object)
{
var index:Number;
var fields:Array;
index = e.target.selectedIndex;
fields = line[index].split(",");
LastName_txt.text = fields[1];
FirstName_txt.text = fields[2];
Dept_txt.text = fields[3];
ClassNo_txt.text = fields[4];
ClassTitle_txt.text = fields[5];
Instructor_txt.text = fields[6];
Score_txt.text = fields[7];
Grade_txt.text = fields[8];
}
IDNo_cbo.addEventListener("change", this);
// ActionScript that creates a white border around the grade viewer.
this.createEmptyMovieClip("border_mc", 1);
border_mc.lineStyle(2,0xFFFFFF,100);
border_mc.moveTo(20,20);
border_mc.lineTo(480,20);
border_mc.lineTo(20,20);
border_mc.lineTo(20,380);
border_mc.lineTo(480,380);
border_mc.lineTo(480,20);
if (_global.styles.Label == undefined) {
_global.styles.Label = new mx.styles.CSSStyleDeclaration();
}
_global.styles.Label.setStyle("color", 0xFFFFFF);
_global.styles.Label.setStyle("fontWeight", "bold");