Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* SNIP */
- var configLoader:URLLoader = new URLLoader(new URLRequest("data/config.xml"));
- configLoader.addEventListener("complete", configLoaded, false, 0, true);
- /* SNIP */
- private function configLoaded(e:Event):void {
- var loader:URLLoader = e.target as URLLoader;
- var configXML:XML;
- try {
- configXML = new XML(loader.data);
- }catch (e:TypeError) {
- trace("ERROR: could not parse the XML file.");
- return;
- }
- Conf._playerScale = configXML.playerScale.@value;
- Conf._walkRate = configXML.walkRate.@value;
- Conf._targetBuffer = configXML.targetBuffer.@value;
- Conf._playerName = configXML.playerName.@value;
- Conf._musicURL = configXML.musicURL.@value;
- Conf._endMusicURL = configXML.endMusicURL.@value;
- Conf._mouseEdge = configXML.mouseEdge.@value;
- Conf._scrollTime = configXML.scrollTime.@value;
- Conf._captionsOn = configXML.captionsOn.@value as Boolean;
- Conf._scenePath = configXML.scenesPath.@value;
- var firstLocation:String = configXML.firstScene.@value;
- createNewScene(firstLocation)
- _currentScene.addEventListener(Event.COMPLETE, maybeStartGame, false, 0, true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement