• jsfl自运行与被调运行


    /**
     * package/demo_Init
     */
    
    /*函数雏形 一定要顶置*/
    var demo_included = {};
    
    //需要导入的类包名称
    var demo_class_arr = [];
    
    //当前路径
    var demo_URI = fl.scriptURI.substr(0, fl.scriptURI.lastIndexOf("/"));
    //父级路径
    var demo_parentURI = demo_URI.substr(0,demo_URI.lastIndexOf("/") + 1);
    var main_good;
    
    function demo_Init(demoCallBack, _doc, _data){
    	
    	fl.trace("demo_Init "+main_good)
    	//demo_common(_doc);
    	//if(demoCallBack)
    	//demoCallBack.call(null,_doc,_data);
    }
    
    function demo_common(_doc){
    	
    }
    
    
    demo_Init();
    
    
    
    /*******************************导入方法**************************************************/
    
    /**
     * 导入类包
     * @param	file  包名 不含后缀
     */
    function demo_includeFile(file) {
         if (demo_included[file]) { return; }
         demo_included[file] = true;
         fl.runScript(demo_parentURI +file + ".jsfl");
    }
    
    /**
     * 导入类包
     */
    function demo_startImport(){
    	for (var i in demo_class_arr) {
    		demo_includeFile(demo_class_arr[i]);
    	}
    }
    

      

    fl.outputPanel.clear();
    
    //完整路径带文件名 如;abc/abc.jsfl
    var root_Wholeurl = fl.scriptURI;
    //jsfl名称带后缀 如;abc.jsfl
    var root_name = fl.scriptURI.substr(fl.scriptURI.lastIndexOf("/") + 1);
    //不带文件名路径但带斜杠 如:abc/
    var root_Url = fl.scriptURI.substr(0, fl.scriptURI.lastIndexOf("/") + 1);
    
    
    /*函数雏形 一定要顶置*/
    var included = {};
    
    //需要导入的类包名称
    var class_arr=["package/demo"];
    
    var main_good=true;
    init();
    
    function init(){
    	startImport();
    //	demo_Init();
    	//fl.trace(SelectData.prototype.get_item_by_flag(fl.getDocumentDOM(), "ab"));
    	////fl.trace(SelectData.prototype.get_item_by_link(fl.getDocumentDOM(), "ab"));
    	////fl.trace(Stage.prototype.GetBGColor(fl.getDocumentDOM()));
    	//Stage.prototype.SetBGColor(fl.getDocumentDOM(), "#000000");
    	//fl.trace(Stage.prototype.GetStageSize(fl.getDocumentDOM()));
    	//Stage.prototype.SetStageSize(fl.getDocumentDOM(),400,500);
    	//fl.trace(Stage.prototype.GetFrameRate(fl.getDocumentDOM()));
    	//Stage.prototype.SetFrameRate(fl.getDocumentDOM(),50)
    	////Stage.prototype.CloseFla(fl.getDocumentDOM(),true);
    	////fl.trace(Stage.prototype.is_url("c:\b"));
    	//fl.trace(Stage.prototype.to_path("b"));
    	
    	
    }
    
    
    
    
    /*******************************导入方法**************************************************/
    
    /**
     * 导入类包
     * @param	file  包名 不含后缀
     */
    function includeFile(file) {
         if (included[file]) { return; }
         included[file] = true;
         fl.runScript(root_Url +file + ".jsfl");
    }
    
    /**
     * 导入类包
     */
    function startImport(){
    	for (var i in class_arr) {
    		includeFile(class_arr[i]);
    	}
    }
    

      

  • 相关阅读:
    Oracle 的字符集与乱码
    linux 时间同步的2种方法
    2 创建型模式-----工厂方法模式
    条款4:确定对象在使用前已被初始化
    条款3:尽可能地使用const
    条款2:尽量以const、enum、inline替换#define
    条款13:以对象管理资源
    条款12:牢记复制对象的所有成员
    条款11:在operator=中处理“自我赋值”
    条款10:令operator=返回一个*this的引用
  • 原文地址:https://www.cnblogs.com/dt1991/p/10956309.html
Copyright © 2020-2023  润新知