简体   繁体   English

如何从文本文件读取并在Flash AS3中填充组合框?

[英]How to read from a text file and populate a combo box in flash AS3?

Suppose a text file contains the following data each separated by a line 假设一个文本文件包含以下数据,每个数据之间用一行分隔

Apple 苹果

Mango 芒果

Orange 橙子

Banana 香蕉

Papaya 番木瓜

How do I read the text file in flash and then display it in a combo box in flash ? 如何在Flash中读取文本文件,然后在Flash的组合框中显示它?

使用URLLoader加载txt文件,然后获取String(data),解析它(string.split(“ \\ n”))并使用for()创建列表并添加到组合框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM