ulfben icon

Sample Config XML load & parse

ulfben | PRO | 04/30/13 12:32:11 PM UTC | 0 ⭐ | 10754 👁️ | Never ⏰ | []
ActionScript 3 |

0 B

|

None

|

0 👍

/

0 👎

/* 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);
        }

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Rteuixl icon
    04/02/26 04:29:53 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎