Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filing dropdown list with a text file

Status
Not open for further replies.

Albano

Instructor
Dec 11, 2000
221
PT
Hello,

I need to create a combobox and fill here with data from a text file.

Thanks.

Albano
 
The combo box can be as simple as a 2 frame movieClip. Frame 1 is the box as it normally appears on the stage with a dynamic textBox and a button to drop down the list (ie gotoAndStop(2))

Frame 2 is the list of options - each one is a dynamic textbox over a button background.

Name the droplist textBox variables "option1" to "option10" (or whatever the maximum number you want to use).

Using loadVariables(); bring your options in from the textfile in the format...

option1="first choice"&option2="second choice"&...

as long as your variable paths are correct (depends if your clip is on the _root level or embedded in another clip) the drop list should then be populated from the text file.

On the button under each option set the variable in the main combo box on the first frame to equal the option chosen...

on(release){
mainOption=option1;
}


It's a bit of an involved explanation but it should work!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top