2 Replies Latest reply on Dec 20, 2016 1:56 AM by KJ_IK4

    Remove stage color for WebGL output (was: WebGL output in Flash CC)


      Hi All,


      This is my first forum post. Mainly becuase all the questions I tend to have are already answered on here. This one however has me stumped.


      I am exporting from Flash to WebGL, which is awesome, but it doesnt allow for the background (stage) color to be removed. I have tried adjusting the outputted js files, but they only allow for hex color adjustment. not rgba or transparent.


      THE QUESTION: Is there a way to remove the stagecolor for webGL output?

      (I am aware the alternative is to utilise the html5 canvas feature, as the backgrounds are transparent by default. But the animations are not as clean and do not achieve the desired effect.)


      Thanks in advance,



        • 1. Re: Remove stage color for WebGL output (was: WebGL output in Flash CC)
          KJ_IK4 Level 1

          Excuse me for a late reply.

          I use Adobe Animate CC 2015 and publish it with webgl mode.

          I also had a similar problem. I solved the problem as follows and I will comment on the method.


          Flash WebGL FILE:


          [Folder] assets (atlas.json / atlas.png / Webgl.json)

          [Folder] libs (flwebgl-0.2.min.js)


          To make "stageColor" transparent, you need to set [alpha: true] when setting "getContext" of canvas.


          There is that alpha setting around line 155 of "flwebgl-0.2.min.js".

          Since it is "alpha:!1" (false) by default, it needs to be "alpha:1," (true).



          try{this.f=a.getContext(n[e],{premultipliedAlpha:!1,alpha:!1,antialias:h[b.Nc]===b.Fe}),this.f.clearColor(1,1,1,1),this.f.clear(this.f.COLOR_BUFFER_BI T)}catch(k){}



          try{this.f=a.getContext(n[e],{premultipliedAlpha:!1,alpha:1,antialias:h[b.Nc]===b.Fe}),this.f.clearColor(1,1,1,1),this.f.clear(this.f.COLOR_BUFFER_BI T)}catch(k){}


          The background of webgl is now displayed transparent.

          • 2. Re: Remove stage color for WebGL output (was: WebGL output in Flash CC)
            KJ_IK4 Level 1

            Excuse me.

            The setting to "alpha=0" was missing.


            There is a code to set the background color around line 108 of "flwebgl-0.2.min.js".

            By default alpha: 255 is set, so modify rgba.

            ------------------------------------------------------------------------------------------ -- -------------


            var n=h[b.Vm],p=new f(n[b.Rj][b.kn],

            n[b.Rj][b.Wm],c.l.U.zd(n[b.fn]),n[b.Um],n[b.$m],n[b.dn]),n=!0==n[b.cn]?new a(h,this,this.T):new e(h,this,this.T);



            var stageColor = c.l.U.zd(h[b.Vm][b.fn]);

            stageColor["alpha"] = 0;

            stageColor["Kf"] = 0;

            stageColor["sf"] = 0;

            stageColor["sw"] = 0;

            stageColor["wf"] = 0;

            stageColor["xe"] = 0;

            var n=h[b.Vm],p=new f(n[b.Rj][b.kn],n[b.Rj][b.Wm],


            n[b.Um],n[b.$m],n[b.dn]),n=!0==n[b.cn]?new a(h,this,this.T):new e(h,this,this.T);

            ------------------------------------------------------------------------------------------ -- -------------


            If you set alpha: 0 together with "alpha:1" in the "getContext" part earlier, the background becomes transparent.

            I wish you good luck.