home *** CD-ROM | disk | FTP | other *** search
- class pro.videotrainingIII.Application
- {
- var timeline;
- var mainData;
- var dictionary;
- var loadingController;
- var contentController;
- var introController;
- static var instance;
- static var thread;
- static var VERSION = "3.120";
- static var WIDTH = 1024;
- static var HEIGHT = 712;
- static var DEPTH_MESSAGE = 310;
- static var DEPTH_BORDER = 300;
- static var DEPTH_INTRO = 299;
- static var DEPTH_LOADER = 200;
- static var DEPTH_CONTENT = 10;
- function Application(mc)
- {
- Stage.scaleMode = "noScale";
- Stage.showMenu = false;
- Stage.align = "TL";
- this.timeline = mc;
- }
- static function main(mc)
- {
- Debugger.debug(" ---------------------------------- ");
- Debugger.debug("Application().main()");
- pro.videotrainingIII.Application.instance = new pro.videotrainingIII.Application(mc);
- pro.videotrainingIII.Application.instance.init();
- }
- function init()
- {
- Debugger.debug(" ---------------------------------- ");
- Debugger.debug("Application().init()");
- pro.videotrainingIII.Application.thread.stop();
- this.setAsFunctions();
- this.mainData = pro.videotrainingIII.data.MainData.getInstance();
- this.dictionary = de.interactivem.env.data.Dictionary.getInstance();
- this.createBorder();
- this.createContentController();
- if(!this.isCMSPlayer())
- {
- this.createIntroController();
- }
- this.loadingController = new pro.videotrainingIII.controller.LoadingController();
- this.loadingController.start();
- }
- function getLoadingController()
- {
- return this.loadingController;
- }
- function setFirstData()
- {
- this.createBorder();
- this.createContentController();
- this.createIntroController();
- }
- function setSecondData()
- {
- Debugger.debug(this + ".setSecondData()");
- if(this.isCMSPlayer())
- {
- this.contentController.init();
- this.startCd();
- }
- else
- {
- this.mainData.sortIndexList();
- this.contentController.init();
- this.introController.start();
- }
- }
- function createBorder()
- {
- var _loc2_ = this.timeline.attachMovie("borderClip","borderMc",pro.videotrainingIII.Application.DEPTH_BORDER);
- _loc2_.onPress = null;
- _loc2_.useHandCursor = false;
- }
- function createDictionary()
- {
- this.dictionary = de.interactivem.env.data.Dictionary.getInstance();
- }
- function getClearText(s)
- {
- s = de.interactivem.env.data.utils.StringUtils.replace(s,"\r","");
- return s;
- }
- function getFromDictionary(key)
- {
- var _loc2_ = this.getClearText(this.dictionary.getEntry(key));
- return _loc2_ == undefined ? "" : _loc2_;
- }
- function getColor(key)
- {
- var _loc2_ = this.getFromDictionary(key);
- return !(_loc2_ != undefined && _loc2_.length > 0) ? null : Number(_loc2_);
- }
- function getMainData()
- {
- return this.mainData;
- }
- function setMediaPath(s)
- {
- var _loc3_ = undefined;
- var _loc4_ = de.interactivem.env.data.utils.StringUtils.hasString(s,"http://") || de.interactivem.env.data.utils.StringUtils.hasString(s,"https://");
- if(_loc4_ == false)
- {
- _loc3_ = this.getRightPathStructur(this.getMediaPath() + s);
- }
- else
- {
- _loc3_ = s;
- }
- return _loc3_;
- }
- function createIntroController()
- {
- this.introController = pro.videotrainingIII.controller.IntroController.getInstance();
- this.introController.create(this.timeline,pro.videotrainingIII.Application.DEPTH_INTRO);
- }
- function getIntroController()
- {
- return this.introController;
- }
- function createContentController()
- {
- this.contentController = new pro.videotrainingIII.controller.ContentController();
- this.contentController.create(this.timeline,pro.videotrainingIII.Application.DEPTH_CONTENT);
- }
- function getContentController()
- {
- return this.contentController;
- }
- function startCd()
- {
- Debugger.debug(" -------------------------------------- ");
- Debugger.debug(this + ".startCd()");
- Debugger.debug(this + ".startCd()._quality: " + _quality);
- this.contentController.checkStartOtions();
- Debugger.debug(this + ".startCd(): Intro ist fertig");
- }
- function addCallback(methodName, instance, method)
- {
- var _loc1_ = netTrekLibs.com.ExternalInterface_netTrek.addCallback(methodName,instance,method);
- if(_loc1_)
- {
- return "";
- }
- return "Die Funktion " + methodName + " konnte nicht angemeldet werden." + "\n";
- }
- function getRightPathStructur(path)
- {
- var _loc3_ = path;
- if(this.isZinc())
- {
- var _loc4_ = _global.mdm.Application.path.substr(-1);
- _loc3_ = de.interactivem.env.data.utils.StringUtils.replace(path,"/",_loc4_);
- }
- return _loc3_;
- }
- function getTimelineChapterId()
- {
- return _level0.chapterId;
- }
- function getTimelineLessonId()
- {
- return _level0.lesssonId;
- }
- function closeApp()
- {
- if(this.isOnline())
- {
- getUrl("JavaScript:window.close()", "");
- }
- else
- {
- _global.mdm.Application.exit();
- }
- }
- function openLinkByLinkDataItem(dataItem)
- {
- var _loc2_ = dataItem.getTarget();
- var _loc3_ = dataItem.getHref();
- if(_loc2_ == pro.videotrainingIII.data.LinkDataItem.TARGET_INFO)
- {
- this.openLink(dataItem.getInfo(),_loc2_);
- }
- else
- {
- this.openLink(_loc3_,_loc2_);
- }
- }
- function openLink(file, target)
- {
- if(this.getMainData().getSharedObjectData().getInternetTransfer() && target == pro.videotrainingIII.data.LinkDataItem.TARGET_BLANK && de.interactivem.env.data.utils.SystemUtils.isOnlineLink(file))
- {
- this.contentController.getInfoPopUp().onOkay = de.interactivem.env.events.Delegate.create(this,this.openLinkDirekt,file,target);
- this.contentController.getInfoPopUp().setOnShowInfo(de.interactivem.env.events.Delegate.create(this.contentController.getHelpWindowController().getSettingsController(),this.contentController.getHelpWindowController().getSettingsController().setInternetTransfer),this.getMainData().getSharedObjectData().getInternetTransfer());
- this.contentController.startInfoPopUp(this.getFromDictionary("internetTransferMessage"));
- }
- else
- {
- this.openLinkDirekt(file,target);
- }
- }
- function openLinkDirekt(file, target)
- {
- if(target == pro.videotrainingIII.data.LinkDataItem.TARGET_BLANK)
- {
- if(this.isZinc())
- {
- if(this.isWindows())
- {
- _global.mdm.System.exec(file);
- }
- else
- {
- _global.mdm.MacShell.exec("open " + file);
- }
- }
- else
- {
- getURL(file,"_blank");
- }
- }
- else if(target == pro.videotrainingIII.data.LinkDataItem.TARGET_PATH)
- {
- if(this.isZinc())
- {
- var _loc6_ = this.getRightPathStructur(this.getApplicationPath() + file);
- _global.mdm.System.exec(_loc6_);
- }
- else
- {
- getURL(this.getApplicationPath() + file,"_blank");
- }
- }
- else if(target == pro.videotrainingIII.data.LinkDataItem.TARGET_MAIL)
- {
- var _loc5_ = "mailto:" + file;
- if(this.isZinc())
- {
- if(this.isWindows())
- {
- _global.mdm.System.exec(_loc5_);
- }
- else
- {
- _global.mdm.MacShell.exec("open " + _loc5_);
- }
- }
- else
- {
- getURL("mailto:" + file,"");
- }
- }
- else if(target == pro.videotrainingIII.data.LinkDataItem.TARGET_INFO)
- {
- this.getContentController().getInfoPopUp().start(file);
- }
- }
- function setAsFunctions()
- {
- MovieClip.prototype.asOpenLink = de.interactivem.env.events.Delegate.create(this,this.asOpenLink);
- MovieClip.prototype.asOpenLinkDirekt = de.interactivem.env.events.Delegate.create(this,this.asOpenLinkDirekt);
- }
- function asOpenLinkDirekt(p)
- {
- var _loc2_ = p.split(",");
- var _loc3_ = _loc2_[0];
- var _loc4_ = _loc2_[1];
- this.openLinkDirekt(_loc3_,_loc4_);
- }
- function asOpenLink(p)
- {
- var _loc2_ = p.split(",");
- var _loc3_ = _loc2_[0];
- var _loc4_ = _loc2_[1];
- this.openLink(_loc3_,_loc4_);
- }
- function isSystemTypeWindows()
- {
- return de.interactivem.env.data.utils.SystemUtils.isSystemTypeWindows();
- }
- function isSystemTypeMacOS()
- {
- return de.interactivem.env.data.utils.SystemUtils.isSystemTypeMacOS();
- }
- function isSystemTypeLinux()
- {
- return de.interactivem.env.data.utils.SystemUtils.isSystemTypeLinux();
- }
- function isOnline()
- {
- var _loc2_ = _global.mdm.Application.path == undefined;
- return _loc2_;
- }
- function isZinc()
- {
- var _loc2_ = _global.mdm.Application.path != undefined;
- return _loc2_;
- }
- function isMac()
- {
- var _loc1_ = de.interactivem.env.data.utils.SystemUtils.isSystemTypeMacOS();
- return _loc1_;
- }
- function isWindows()
- {
- var _loc1_ = de.interactivem.env.data.utils.SystemUtils.isSystemTypeWindows();
- return _loc1_;
- }
- function getSystemType()
- {
- if(this.isOnline())
- {
- return de.interactivem.env.data.utils.SystemUtils.PLAYER_TYPE_ONLINE;
- }
- if(this.isWindows())
- {
- return de.interactivem.env.data.utils.SystemUtils.SYSTEM_TYPE_WINDOWS;
- }
- if(this.isMac())
- {
- return de.interactivem.env.data.utils.SystemUtils.SYSTEM_TYPE_MACOS;
- }
- }
- function isCMSPlayer()
- {
- return de.interactivem.gui.utils.MovieClipUtils.getRootVar("cms") == "1";
- }
- function getTimeline()
- {
- return this.timeline;
- }
- function getApplicationPath()
- {
- var _loc3_ = this.mainData.getAppData().getGateway();
- var _loc4_ = de.interactivem.gui.utils.MovieClipUtils.getRootVar("url");
- var _loc5_ = _global.mdm.Application.path;
- if(this.isZinc())
- {
- _loc3_ = _loc5_;
- }
- else if(_loc4_ != null)
- {
- _loc3_ = _loc4_;
- }
- else if(_loc3_ == undefined)
- {
- _loc3_ = "";
- }
- return _loc3_;
- }
- function getFolder(folder)
- {
- var _loc2_ = this.getApplicationPath() + this.getRightPathStructur(folder);
- return _loc2_;
- }
- function getMediaPath()
- {
- return this.getFolder(this.mainData.getAppData().getFolderName());
- }
- function getDataPath()
- {
- var _loc2_ = "system/data/";
- var _loc4_ = de.interactivem.gui.utils.MovieClipUtils.getRootVar("dataPath");
- var _loc3_ = this.mainData.getAppData().getDataPath();
- if(_loc4_ != null)
- {
- _loc2_ = _loc4_;
- }
- else if(_loc3_ != null)
- {
- _loc2_ = _loc3_;
- }
- return this.getFolder(_loc2_);
- }
- static function getInstance()
- {
- return pro.videotrainingIII.Application.instance;
- }
- function toString()
- {
- return "Application";
- }
- }
-