home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 149 / MOBICLIC149.ISO / pc / DATA / DSS149 / DSS149_03 / DSS149_03.swf / scripts / dss149_03 / ModuleConfig.as < prev    next >
Text File  |  2012-11-21  |  1KB  |  45 lines

  1. package dss149_03
  2. {
  3.    public class ModuleConfig
  4.    {
  5.        
  6.       
  7.       public var vitessePerso:int = 5;
  8.       
  9.       private var listeObject:Object;
  10.       
  11.       public function ModuleConfig(xml:*)
  12.       {
  13.          this.listeObject = {};
  14.          super();
  15.          if(xml != null && xml.length() > 0)
  16.          {
  17.             new ObjectInitializer(this,this.listeObject,xml);
  18.          }
  19.       }
  20.       
  21.       public function toString() : void
  22.       {
  23.          var prop:* = null;
  24.          trace("--- moduleConfig ---");
  25.          for(prop in this.listeObject)
  26.          {
  27.             trace(prop," : ",this[prop]);
  28.          }
  29.          trace("---  ---");
  30.       }
  31.       
  32.       public function toXMLString() : String
  33.       {
  34.          var prop:* = null;
  35.          trace("--- moduleConfig.toXML() ---");
  36.          var xml:String = "<Params>\n";
  37.          for(prop in this.listeObject)
  38.          {
  39.             xml += "\t<Param nom=\"" + prop + "\" valeur=\"" + this[prop] + "\"/>\n";
  40.          }
  41.          return xml + "</Params>";
  42.       }
  43.    }
  44. }
  45.