reading simple INI file with AS3

孤人 提交于 2019-12-10 13:41:41

问题


What AS3 class should I use to read a simple property/ini file into memory to configure some settings such as colors easily for the project.

format could be

key=value <newline>

I like to access it with this kind of API: trace ( Settings.get("key") )


回答1:


There is no built-in way to do this in AS3, but we have support for loading and parsing properties files in Spring ActionScript.

Here are the direct links to the sources:

  • Properties
  • PropertiesParser (used internally in Properties)



回答2:


I you can choose your format freely XML is very easy to deal with in actionscript3, it might not be perfect for super simple config files, but it's extremely easy to handle once you get it in.

This page looks to have a reasonable overview: http://dispatchevent.org/roger/as3-e4x-rundown/



来源:https://stackoverflow.com/questions/589688/reading-simple-ini-file-with-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!