Jump to content
Search Community

12704_1494126580

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by 12704_1494126580

  1. I am trying to animate the mask_mc from left to right using TimelineMax. I need a simple setup to set the position then move it across. Help is greatly appreciated.

     

    var mask_mc = this.mask_mc;
    var maskedContent = this.maskedContent;


    //AlphaGradientMask
    maskedContent.filters = [
        new createjs.AlphaMaskFilter(mask_mc.cacheCanvas)
    ];

    maskedContent.updateCache();

    // create timeline
    var tl = new TimelineMax();


    tl.to(mask_mc.getChildAt(0), 3,{x:400, onUpdate:updateMask}, 'start')


    //AlphaMaskFilter needs to be updated on every tick if it has to tween.
    function updateMask(){
        mask_mc.updateCache();
        exportRoot.maskedContent.filters = [
            new createjs.AlphaMaskFilter(mask_mc.cacheCanvas)
        ];

        exportRoot.maskedContent.updateCache();
        console.log('updating');
    }

×
×
  • Create New...