home *** CD-ROM | disk | FTP | other *** search
- package controller.load
- {
- import com.je.data.Queue;
- import com.je.events.AssetManagerEvent;
- import com.je.model.ApplicationModel;
- import com.je.model.AssetManager;
- import com.je.model.ChapterList;
- import com.je.model.vo.Chapter;
- import com.je.model.vo.Lesson;
- import com.je.model.vo.LessonInformation;
- import controller.TraceController;
- import org.robotlegs.mvcs.Command;
-
- public class LoadImagesCommand extends Command
- {
- [Inject]
- public var assetManager:AssetManager;
-
- [Inject]
- public var applicationModel:ApplicationModel;
-
- public function LoadImagesCommand()
- {
- super();
- }
-
- override public function execute() : void
- {
- var _loc4_:Chapter = null;
- var _loc5_:* = undefined;
- var _loc6_:int = 0;
- var _loc7_:Lesson = null;
- var _loc8_:LessonInformation = null;
- TraceController.getInstance().tracef("LoadImagesCommand");
- var _loc1_:Queue = new Queue(AssetManagerEvent.IMAGES_LOADED);
- var _loc2_:ChapterList = this.applicationModel.chapterList;
- var _loc3_:int = 0;
- while(_loc3_ < _loc2_.getAllChapters().length)
- {
- _loc4_ = _loc2_.getAllChapters()[_loc3_];
- _loc5_ = _loc4_.info;
- if(_loc5_)
- {
- _loc1_.add(_loc4_.id + "_chapterInfoPreviewImage",this.applicationModel.trainingInfo.folderName + _loc5_.previewImagePath);
- }
- _loc6_ = 0;
- while(_loc6_ < _loc4_.getAllLessons().length)
- {
- _loc7_ = _loc4_.getAllLessons()[_loc6_];
- _loc8_ = _loc7_.info;
- _loc1_.add(_loc4_.id + "_lessonInfoPreviewImage_" + (_loc6_ + 1),this.applicationModel.trainingInfo.folderName + _loc8_.previewImagePath);
- _loc6_++;
- }
- _loc3_++;
- }
- _loc1_.add("appPic",this.applicationModel.trainingInfo.folderName + this.applicationModel.trainingInfo.mainApplicationImagePath);
- _loc1_.add("trainerPic",this.applicationModel.trainingInfo.folderName + this.applicationModel.trainerInfo.imagePath);
- this.assetManager.addQueue(_loc1_);
- this.assetManager.load();
- }
- }
- }
-
-