Hãy đăng ký thành viên để có thể dễ dàng trao đổi, giao lưu và chia sẻ về kiến thức đồ họa.
  1. Hãy đăng ký subscribe kênh Youtube mới của Việt Designer tại địa chỉ: Youtube.com/VietDesignerChannel để theo dõi các video về thiết kế đồ họa. Do trước đó kênh cũ bị Youtube quét không rõ lý do, trong thời gian chờ kháng cáo nếu các bạn thấy video trên diễn đàn bị die không xem được thì có thể vào kênh mới để tìm xem video sơ cua nhé.
    Loại bỏ thông báo

Cần Giúp đỡ về Adobe Animate CC 2017

Chủ đề thuộc danh mục 'Adobe InDesign' được đăng bởi Tuấn0001, 30/9/17.

Lượt xem: 5,236

  1. Tuấn0001 Mới đăng kí

    Hiện tại e đang làm tập tành làm banner Html5 Canvas Animate CC 2017. cho e hỏi làm thế nào để 2 banner chạy cùng trên 1 trang (website) được vậy mọi người. Em chèn 2 cái html vào web nhưng 1 cái chạy được 1 cái thì không. còn chạy riêng từng cái thì chạy được. e cũng đã thay đổi giá trị ID. nhưng vẫn không được.
    Code Banner 1
    HTML:
    <!DOCTYPE html>
    <!--
        NOTES:
        1. All tokens are represented by '$' sign in the template.
        2. You can write your code only wherever mentioned.
        3. All occurrences of existing tokens will be replaced by their appropriate values.
        4. Blank lines will be removed automatically.
        5. Remove unnecessary comments before creating your template.
    -->
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="authoring-tool" content="Adobe_Animate_CC">
    <title>banner_022</title>
    <!-- write your code here -->
    <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
    <script>
    var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
    function init() {
        canvas = document.getElementById("111");
        anim_container = document.getElementById("11111");
        dom_overlay_container = document.getElementById("dom_overlay_container");
        images = images||{};
        ss = ss||{};
        var loader = new createjs.LoadQueue(false);
        loader.addEventListener("fileload", handleFileLoad);
        loader.addEventListener("complete", handleComplete);
        loader.loadManifest(lib.properties.manifest);
    }
    function handleFileLoad(evt) {   
        if (evt.item.type == "image") { images[evt.item.id] = evt.result; }   
    }
    function handleComplete(evt) {
        //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
        var queue = evt.target;
        var ssMetadata = lib.ssMetadata;
        for(i=0; i<ssMetadata.length; i++) {
            ss[ssMetadata[i].name] = new createjs.SpriteSheet( {"images": [queue.getResult(ssMetadata[i].name)], "frames": ssMetadata[i].frames} )
        }
        exportRoot = new lib.banner_022();
        stage = new createjs.Stage(canvas);
        stage.addChild(exportRoot);   
        //Registers the "tick" event listener.
        fnStartAnimation = function() {
            createjs.Ticker.setFPS(lib.properties.fps);
            createjs.Ticker.addEventListener("tick", stage);
        }       
        //Code to support hidpi screens and responsive scaling.
        function makeResponsive(isResp, respDim, isScale, scaleType) {       
            var lastW, lastH, lastS=1;       
            window.addEventListener('resize', resizeCanvas);       
            resizeCanvas();       
            function resizeCanvas() {           
                var w = lib.properties.width, h = lib.properties.height;           
                var iw = window.innerWidth, ih=window.innerHeight;           
                var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;           
                if(isResp) {               
                    if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {                   
                        sRatio = lastS;               
                    }               
                    else if(!isScale) {                   
                        if(iw<w || ih<h)                       
                            sRatio = Math.min(xRatio, yRatio);               
                    }               
                    else if(scaleType==1) {                   
                        sRatio = Math.min(xRatio, yRatio);               
                    }               
                    else if(scaleType==2) {                   
                        sRatio = Math.max(xRatio, yRatio);               
                    }           
                }           
                canvas.width = w*pRatio*sRatio;           
                canvas.height = h*pRatio*sRatio;
                canvas.style.width = w*sRatio+'px';               
                canvas.style.height = h*sRatio+'px';
                stage.scaleX = pRatio*sRatio;           
                stage.scaleY = pRatio*sRatio;           
                lastW = iw; lastH = ih; lastS = sRatio;       
            }
        }
        makeResponsive(false,'both',false,1);   
        fnStartAnimation();
    }
    
    
    (function (lib, img, cjs, ss, an) {
    
    var p; // shortcut to reference prototypes
    lib.webFontTxtInst = {};
    var loadedTypekitCount = 0;
    var loadedGoogleCount = 0;
    var gFontsUpdateCacheList = [];
    var tFontsUpdateCacheList = [];
    var rect; // used to reference frame bounds
    lib.ssMetadata = [
            {name:"banner_022_atlas_", frames: [[0,326,324,324],[0,0,324,324]]}
    ];
    
    
    
    lib.updateListCache = function (cacheList) {       
        for(var i = 0; i < cacheList.length; i++) {       
            if(cacheList[i].cacheCanvas)       
                cacheList[i].updateCache();       
        }       
    };       
    
    lib.addElementsToCache = function (textInst, cacheList) {       
        var cur = textInst;       
        while(cur != exportRoot) {       
            if(cacheList.indexOf(cur) != -1)       
                break;       
            cur = cur.parent;       
        }       
        if(cur != exportRoot) {       
            var cur2 = textInst;       
            var index = cacheList.indexOf(cur);       
            while(cur2 != cur) {       
                cacheList.splice(index, 0, cur2);       
                cur2 = cur2.parent;       
                index++;       
            }       
        }       
        else {       
            cur = textInst;       
            while(cur != exportRoot) {       
                cacheList.push(cur);       
                cur = cur.parent;       
            }       
        }       
    };       
    
    lib.gfontAvailable = function(family, totalGoogleCount) {       
        lib.properties.webfonts[family] = true;       
        var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];       
        for(var f = 0; f < txtInst.length; ++f)       
            lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);       
    
        loadedGoogleCount++;       
        if(loadedGoogleCount == totalGoogleCount) {       
            lib.updateListCache(gFontsUpdateCacheList);       
        }       
    };       
    
    lib.tfontAvailable = function(family, totalTypekitCount) {       
        lib.properties.webfonts[family] = true;       
        var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];       
        for(var f = 0; f < txtInst.length; ++f)       
            lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);       
    
        loadedTypekitCount++;       
        if(loadedTypekitCount == totalTypekitCount) {       
            lib.updateListCache(tFontsUpdateCacheList);       
        }       
    };
    // symbols:
    
    
    
    (lib._4 = function() {
        this.spriteSheet = ss["banner_022_atlas_"];
        this.gotoAndStop(0);
    }).prototype = p = new cjs.Sprite();
    
    
    
    (lib._5 = function() {
        this.spriteSheet = ss["banner_022_atlas_"];
        this.gotoAndStop(1);
    }).prototype = p = new cjs.Sprite();
    // helper functions:
    
    function mc_symbol_clone() {
        var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
        clone.gotoAndStop(this.currentFrame);
        clone.paused = this.paused;
        clone.framerate = this.framerate;
        return clone;
    }
    
    function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
        var prototype = cjs.extend(symbol, cjs.MovieClip);
        prototype.clone = mc_symbol_clone;
        prototype.nominalBounds = nominalBounds;
        prototype.frameBounds = frameBounds;
        return prototype;
        }
    
    
    (lib.hinh_2 = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 1
        this.instance = new lib._5();
        this.instance.parent = this;
    
        this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
    
    }).prototype = getMCSymbolPrototype(lib.hinh_2, rect = new cjs.Rectangle(0,0,324,324), [rect]);
    
    
    (lib.hinh_1 = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 1
        this.instance = new lib._4();
        this.instance.parent = this;
    
        this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
    
    }).prototype = getMCSymbolPrototype(lib.hinh_1, rect = new cjs.Rectangle(0,0,324,324), [rect]);
    
    
    // stage content:
    (lib.banner_022 = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 2
        this.instance = new lib.hinh_2();
        this.instance.parent = this;
        this.instance.setTransform(501,162,1,1,0,0,0,162,162);
    
        this.timeline.addTween(cjs.Tween.get(this.instance).to({x:-186},69).wait(1));
    
        // Layer 1
        this.instance_1 = new lib.hinh_1();
        this.instance_1.parent = this;
        this.instance_1.setTransform(-200.9,162,1,1,0,0,0,162,162);
    
        this.timeline.addTween(cjs.Tween.get(this.instance_1).to({x:498},69).wait(1));
    
    }).prototype = p = new cjs.MovieClip();
    p.nominalBounds = rect = new cjs.Rectangle(-200.9,162,1026,324);
    p.frameBounds = [rect, new cjs.Rectangle(-190.8,162,1005.9,324), new cjs.Rectangle(-180.7,162,985.8,324), new cjs.Rectangle(-170.5,162,965.7,324), new cjs.Rectangle(-160.4,162,945.7,324), new cjs.Rectangle(-150.3,162,925.5,324), new cjs.Rectangle(-140.1,162,905.4,324), new cjs.Rectangle(-130,162,885.4,324), new cjs.Rectangle(-119.9,162,865.3,324), new cjs.Rectangle(-109.8,162,845.2,324), new cjs.Rectangle(-99.6,162,825.1,324), new cjs.Rectangle(-89.5,162,805,324), new cjs.Rectangle(-79.4,162,784.9,324), new cjs.Rectangle(-69.2,162,764.8,324), new cjs.Rectangle(-59.1,162,744.8,324), new cjs.Rectangle(-49,162,724.7,324), new cjs.Rectangle(-38.8,162,704.6,324), new cjs.Rectangle(-28.7,162,684.5,324), new cjs.Rectangle(-18.6,162,664.4,324), new cjs.Rectangle(-8.5,162,644.4,324), new cjs.Rectangle(1.7,162,624.2,324), new cjs.Rectangle(11.8,162,604.1,324), new cjs.Rectangle(21.9,162,584.1,324), new cjs.Rectangle(32.1,162,564,324), new cjs.Rectangle(42.2,162,543.9,324), new cjs.Rectangle(52.3,162,523.8,324), new cjs.Rectangle(62.4,162,503.8,324), new cjs.Rectangle(72.6,162,483.6,324), new cjs.Rectangle(82.7,162,463.5,324), new cjs.Rectangle(92.8,162,443.5,324), new cjs.Rectangle(103,162,423.4,324), new cjs.Rectangle(113.1,162,403.3,324), new cjs.Rectangle(123.2,162,383.2,324), new cjs.Rectangle(133.4,162,363.1,324), new cjs.Rectangle(143.5,162,343.1,324), new cjs.Rectangle(152.5,162,325.1,324), new cjs.Rectangle(142.6,162,345.2,324), new cjs.Rectangle(132.6,162,365.3,324), new cjs.Rectangle(122.7,162,385.3,324), new cjs.Rectangle(112.7,162,405.4,324), new cjs.Rectangle(102.8,162,425.5,324), new cjs.Rectangle(92.8,162,445.6,324), new cjs.Rectangle(82.9,162,465.7,324), new cjs.Rectangle(72.9,162,485.8,324), new cjs.Rectangle(62.9,162,505.9,324), new cjs.Rectangle(53,162,525.9,324), new cjs.Rectangle(43,162,546,324), new cjs.Rectangle(33.1,162,566.1,324), new cjs.Rectangle(23.1,162,586.2,324), new cjs.Rectangle(13.2,162,606.3,324), new cjs.Rectangle(3.2,162,626.4,324), new cjs.Rectangle(-6.8,162,646.5,324), new cjs.Rectangle(-16.7,162,666.6,324), new cjs.Rectangle(-26.7,162,686.6,324), new cjs.Rectangle(-36.7,162,706.7,324), new cjs.Rectangle(-46.6,162,726.8,324), new cjs.Rectangle(-56.6,162,746.8,324), new cjs.Rectangle(-66.5,162,767,324), new cjs.Rectangle(-76.4,162,787,324), new cjs.Rectangle(-86.4,162,807.2,324), new cjs.Rectangle(-96.4,162,827.3,324), new cjs.Rectangle(-106.4,162,847.3,324), new cjs.Rectangle(-116.3,162,867.4,324), new cjs.Rectangle(-126.2,162,887.5,324), new cjs.Rectangle(-136.2,162,907.6,324), new cjs.Rectangle(-146.2,162,927.7,324), new cjs.Rectangle(-156.1,162,947.8,324), new cjs.Rectangle(-166.1,162,967.9,324), new cjs.Rectangle(-176,162,987.9,324), new cjs.Rectangle(-186,162,1008,324)];
    // library properties:
    lib.properties = {
        width: 324,
        height: 324,
        fps: 24,
        color: "#FFFFFF",
        opacity: 1.00,
        webfonts: {},
        manifest: [
            {src:"https://123tintuc.com/wp-content/uploads/2017/09/banner_022_atlas_-1.png", id:"banner_022_atlas_"}
        ],
        preloads: []
    };
    
    
    
    
    })(lib = lib||{}, images = images||{}, createjs = createjs||{}, ss = ss||{}, AdobeAn = AdobeAn||{});
    var lib, images, createjs, ss, AdobeAn;
    
    
    </script>
    <!-- write your code here -->
    </head>
    <body onload="init();" style="margin:0px;">
        <div id="11111" style="background-color:#000; width:324px; height:324px">
            <canvas id="111" width="324" height="324" style="position: absolute; display: block; background-color:#000;"></canvas>
            <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:324px; height:324px; position: absolute; left: 0px; top: 0px; display: block;">
            </div>
        </div>
    </body>
    </html>

    Code Banner 2
    HTML:
    <!DOCTYPE html>
    <!--
        NOTES:
        1. All tokens are represented by '$' sign in the template.
        2. You can write your code only wherever mentioned.
        3. All occurrences of existing tokens will be replaced by their appropriate values.
        4. Blank lines will be removed automatically.
        5. Remove unnecessary comments before creating your template.
    -->
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="authoring-tool" content="Adobe_Animate_CC">
    <title>yyy</title>
    <!-- write your code here -->
    <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
    <script src="yyy.js"></script>
    <script>
    
    
    (function (lib, img, cjs, ss, an) {
    
    var p; // shortcut to reference prototypes
    lib.webFontTxtInst = {};
    var loadedTypekitCount = 0;
    var loadedGoogleCount = 0;
    var gFontsUpdateCacheList = [];
    var tFontsUpdateCacheList = [];
    var rect; // used to reference frame bounds
    lib.ssMetadata = [
            {name:"yyy_atlas_", frames: [[0,326,324,324],[0,0,324,324]]}
    ];
    
    
    
    lib.updateListCache = function (cacheList) {       
        for(var i = 0; i < cacheList.length; i++) {       
            if(cacheList[i].cacheCanvas)       
                cacheList[i].updateCache();       
        }       
    };       
    
    lib.addElementsToCache = function (textInst, cacheList) {       
        var cur = textInst;       
        while(cur != exportRoot) {       
            if(cacheList.indexOf(cur) != -1)       
                break;       
            cur = cur.parent;       
        }       
        if(cur != exportRoot) {       
            var cur2 = textInst;       
            var index = cacheList.indexOf(cur);       
            while(cur2 != cur) {       
                cacheList.splice(index, 0, cur2);       
                cur2 = cur2.parent;       
                index++;       
            }       
        }       
        else {       
            cur = textInst;       
            while(cur != exportRoot) {       
                cacheList.push(cur);       
                cur = cur.parent;       
            }       
        }       
    };       
    
    lib.gfontAvailable = function(family, totalGoogleCount) {       
        lib.properties.webfonts[family] = true;       
        var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];       
        for(var f = 0; f < txtInst.length; ++f)       
            lib.addElementsToCache(txtInst[f], gFontsUpdateCacheList);       
    
        loadedGoogleCount++;       
        if(loadedGoogleCount == totalGoogleCount) {       
            lib.updateListCache(gFontsUpdateCacheList);       
        }       
    };       
    
    lib.tfontAvailable = function(family, totalTypekitCount) {       
        lib.properties.webfonts[family] = true;       
        var txtInst = lib.webFontTxtInst && lib.webFontTxtInst[family] || [];       
        for(var f = 0; f < txtInst.length; ++f)       
            lib.addElementsToCache(txtInst[f], tFontsUpdateCacheList);       
    
        loadedTypekitCount++;       
        if(loadedTypekitCount == totalTypekitCount) {       
            lib.updateListCache(tFontsUpdateCacheList);       
        }       
    };
    // symbols:
    
    
    
    (lib._1 = function() {
        this.spriteSheet = ss["yyy_atlas_"];
        this.gotoAndStop(0);
    }).prototype = p = new cjs.Sprite();
    
    
    
    (lib._2 = function() {
        this.spriteSheet = ss["yyy_atlas_"];
        this.gotoAndStop(1);
    }).prototype = p = new cjs.Sprite();
    // helper functions:
    
    function mc_symbol_clone() {
        var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
        clone.gotoAndStop(this.currentFrame);
        clone.paused = this.paused;
        clone.framerate = this.framerate;
        return clone;
    }
    
    function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
        var prototype = cjs.extend(symbol, cjs.MovieClip);
        prototype.clone = mc_symbol_clone;
        prototype.nominalBounds = nominalBounds;
        prototype.frameBounds = frameBounds;
        return prototype;
        }
    
    
    (lib.anh_2 = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 1
        this.instance = new lib._2();
        this.instance.parent = this;
    
        this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
    
    }).prototype = getMCSymbolPrototype(lib.anh_2, rect = new cjs.Rectangle(0,0,324,324), [rect]);
    
    
    (lib.anh_1 = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 1
        this.instance = new lib._1();
        this.instance.parent = this;
    
        this.timeline.addTween(cjs.Tween.get(this.instance).wait(1));
    
    }).prototype = getMCSymbolPrototype(lib.anh_1, rect = new cjs.Rectangle(0,0,324,324), [rect]);
    
    
    // stage content:
    (lib.yyy = function(mode,startPosition,loop) {
        this.initialize(mode,startPosition,loop,{});
    
        // Layer 2
        this.instance = new lib.anh_2();
        this.instance.parent = this;
        this.instance.setTransform(-167,162,1,1,0,0,0,162,162);
    
        this.timeline.addTween(cjs.Tween.get(this.instance).to({x:539},69).wait(1));
    
        // Layer 1
        this.instance_1 = new lib.anh_1();
        this.instance_1.parent = this;
        this.instance_1.setTransform(504,162,1,1,0,0,0,162,162);
    
        this.timeline.addTween(cjs.Tween.get(this.instance_1).to({x:-172},69).wait(1));
    
    }).prototype = p = new cjs.MovieClip();
    p.nominalBounds = rect = new cjs.Rectangle(-167,162,995,324);
    p.frameBounds = [rect, new cjs.Rectangle(-156.7,162,975,324), new cjs.Rectangle(-146.5,162,955,324), new cjs.Rectangle(-136.3,162,934.9,324), new cjs.Rectangle(-126.1,162,914.9,324), new cjs.Rectangle(-115.9,162,894.9,324), new cjs.Rectangle(-105.6,162,874.8,324), new cjs.Rectangle(-95.4,162,854.8,324), new cjs.Rectangle(-85.1,162,834.8,324), new cjs.Rectangle(-74.9,162,814.8,324), new cjs.Rectangle(-64.7,162,794.8,324), new cjs.Rectangle(-54.4,162,774.7,324), new cjs.Rectangle(-44.2,162,754.7,324), new cjs.Rectangle(-34,162,734.7,324), new cjs.Rectangle(-23.7,162,714.6,324), new cjs.Rectangle(-13.6,162,694.6,324), new cjs.Rectangle(-3.3,162,674.6,324), new cjs.Rectangle(6.9,162,654.5,324), new cjs.Rectangle(17.2,162,634.5,324), new cjs.Rectangle(27.4,162,614.5,324), new cjs.Rectangle(37.6,162,594.5,324), new cjs.Rectangle(47.8,162,574.4,324), new cjs.Rectangle(58.1,162,554.4,324), new cjs.Rectangle(68.3,162,534.4,324), new cjs.Rectangle(78.6,162,514.3,324), new cjs.Rectangle(88.8,162,494.3,324), new cjs.Rectangle(99,162,474.3,324), new cjs.Rectangle(109.3,162,454.2,324), new cjs.Rectangle(119.5,162,434.3,324), new cjs.Rectangle(129.7,162,414.2,324), new cjs.Rectangle(140,162,394.2,324), new cjs.Rectangle(150.2,162,374.2,324), new cjs.Rectangle(160.4,162,354.1,324), new cjs.Rectangle(170.6,162,334.1,324), new cjs.Rectangle(170.9,162,334,324), new cjs.Rectangle(161.1,162,354,324), new cjs.Rectangle(151.3,162,374.1,324), new cjs.Rectangle(141.5,162,394.1,324), new cjs.Rectangle(131.7,162,414.1,324), new cjs.Rectangle(121.9,162,434.1,324), new cjs.Rectangle(112.1,162,454.2,324), new cjs.Rectangle(102.3,162,474.2,324), new cjs.Rectangle(92.6,162,494.2,324), new cjs.Rectangle(82.8,162,514.2,324), new cjs.Rectangle(73,162,534.2,324), new cjs.Rectangle(63.2,162,554.3,324), new cjs.Rectangle(53.4,162,574.3,324), new cjs.Rectangle(43.6,162,594.3,324), new cjs.Rectangle(33.8,162,614.4,324), new cjs.Rectangle(23.9,162,634.4,324), new cjs.Rectangle(14.2,162,654.4,324), new cjs.Rectangle(4.3,162,674.4,324), new cjs.Rectangle(-5.4,162,694.5,324), new cjs.Rectangle(-15.2,162,714.5,324), new cjs.Rectangle(-25.1,162,734.6,324), new cjs.Rectangle(-34.8,162,754.6,324), new cjs.Rectangle(-44.7,162,774.6,324), new cjs.Rectangle(-54.4,162,794.6,324), new cjs.Rectangle(-64.2,162,814.7,324), new cjs.Rectangle(-74.1,162,834.7,324), new cjs.Rectangle(-83.8,162,854.7,324), new cjs.Rectangle(-93.6,162,874.8,324), new cjs.Rectangle(-103.4,162,894.8,324), new cjs.Rectangle(-113.2,162,914.8,324), new cjs.Rectangle(-123,162,934.8,324), new cjs.Rectangle(-132.8,162,954.9,324), new cjs.Rectangle(-142.6,162,974.9,324), new cjs.Rectangle(-152.4,162,994.9,324), new cjs.Rectangle(-162.2,162,1014.9,324), new cjs.Rectangle(-172,162,1035,324)];
    // library properties:
    lib.properties = {
        width: 324,
        height: 324,
        fps: 24,
        color: "#FFFFFF",
        opacity: 1.00,
        webfonts: {},
        manifest: [
            {src:"https://123tintuc.com/wp-content/uploads/2017/09/yyy_atlas_.png", id:"yyy_atlas_"}
        ],
        preloads: []
    };
    
    
    
    
    })(lib = lib||{}, images = images||{}, createjs = createjs||{}, ss = ss||{}, AdobeAn = AdobeAn||{});
    var lib, images, createjs, ss, AdobeAn;
    
    
    
    
    
    
    var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
    function init() {
        canvas = document.getElementById("banner1");
        anim_container = document.getElementById("contain1");
        dom_overlay_container = document.getElementById("dom_overlay_container");
        images = images||{};
        ss = ss||{};
        var loader = new createjs.LoadQueue(false);
        loader.addEventListener("fileload", handleFileLoad);
        loader.addEventListener("complete", handleComplete);
        loader.loadManifest(lib.properties.manifest);
    }
    function handleFileLoad(evt) {   
        if (evt.item.type == "image") { images[evt.item.id] = evt.result; }   
    }
    function handleComplete(evt) {
        //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
        var queue = evt.target;
        var ssMetadata = lib.ssMetadata;
        for(i=0; i<ssMetadata.length; i++) {
            ss[ssMetadata[i].name] = new createjs.SpriteSheet( {"images": [queue.getResult(ssMetadata[i].name)], "frames": ssMetadata[i].frames} )
        }
        exportRoot = new lib.yyy();
        stage = new createjs.Stage(canvas);
        stage.addChild(exportRoot);   
        //Registers the "tick" event listener.
        fnStartAnimation = function() {
            createjs.Ticker.setFPS(lib.properties.fps);
            createjs.Ticker.addEventListener("tick", stage);
        }       
        //Code to support hidpi screens and responsive scaling.
        function makeResponsive(isResp, respDim, isScale, scaleType) {       
            var lastW, lastH, lastS=1;       
            window.addEventListener('resize', resizeCanvas);       
            resizeCanvas();       
            function resizeCanvas() {           
                var w = lib.properties.width, h = lib.properties.height;           
                var iw = window.innerWidth, ih=window.innerHeight;           
                var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;           
                if(isResp) {               
                    if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {                   
                        sRatio = lastS;               
                    }               
                    else if(!isScale) {                   
                        if(iw<w || ih<h)                       
                            sRatio = Math.min(xRatio, yRatio);               
                    }               
                    else if(scaleType==1) {                   
                        sRatio = Math.min(xRatio, yRatio);               
                    }               
                    else if(scaleType==2) {                   
                        sRatio = Math.max(xRatio, yRatio);               
                    }           
                }           
                canvas.width = w*pRatio*sRatio;           
                canvas.height = h*pRatio*sRatio;
                canvas.style.width = w*sRatio+'px';               
                canvas.style.height = h*sRatio+'px';
                stage.scaleX = pRatio*sRatio;           
                stage.scaleY = pRatio*sRatio;           
                lastW = iw; lastH = ih; lastS = sRatio;       
            }
        }
        makeResponsive(false,'both',false,1);   
        fnStartAnimation();
    }
    
    
    
    
    
    </script>
    <!-- write your code here -->
    </head>
    <body onload="init();" style="margin:0px;">
        <div id="contain1" style="background-color:#000; width:324px; height:324px">
            <canvas id="banner1" width="324" height="324" style="position: absolute; display: block; background-color:#000;"></canvas>
            <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:324px; height:324px; position: absolute; left: 0px; top: 0px; display: block;">
            </div>
        </div>
    </body>
    </html>

    ...

Ủng hộ diễn đàn