home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / controller / parse / ParseHelpCommand.as < prev    next >
Encoding:
Text File  |  2010-11-30  |  967 b   |  33 lines

  1. package controller.parse
  2. {
  3.    import com.je.data.parser.IParser;
  4.    import com.je.events.UpdateEvent;
  5.    import com.je.model.Assets;
  6.    import com.je.model.ChapterList;
  7.    import data.parser.ChapterParser;
  8.    import org.robotlegs.mvcs.Command;
  9.    
  10.    public class ParseHelpCommand extends Command
  11.    {
  12.       [Inject]
  13.       public var assets:Assets;
  14.       
  15.       public function ParseHelpCommand()
  16.       {
  17.          super();
  18.       }
  19.       
  20.       override public function execute() : void
  21.       {
  22.          var mainXml:XMLList = null;
  23.          var chapterParser:IParser = null;
  24.          var chapterList:ChapterList = null;
  25.          mainXml = new XMLList(this.assets.getAssetByLinkedID("mainXml"))..chapter.(@type == "help");
  26.          chapterParser = new ChapterParser();
  27.          chapterList = ChapterList(chapterParser.parse(mainXml));
  28.          dispatch(new UpdateEvent(UpdateEvent.UPDATE_HELP_CHAPTER_LIST,chapterList));
  29.       }
  30.    }
  31. }
  32.  
  33.