Trabla: Flash & ActionScript3 - load config json file
Solving:
...
public function loadConfig(){
var loader:URLLoader = new URLLoader();
loader.load( new URLRequest( 'config.json' ) );
loader.addEventListener( Event.COMPLETE , processConfig );
}
public function processConfig(e:Event):void{
// Content of the file config.json - e.target.data
var config:Object = JSON.parse( e.target.data );
//Process Config Object
...
}
No comments:
Post a Comment