2 Replies Latest reply on May 18, 2015 9:02 PM by Ylazy

    Flash CC HTML5 Canvas margins and padding

    johnl21393169

      Setting up an HTML 5 canvas in Flash CC and when I preview in the browser it has padding around it and I would like to align it to the top left of the browser. Is there a way to set this up within Flash or do I have to change the style with in the .HTML file?

        • 1. Re: Flash CC HTML5 Canvas margins and padding
          Colin Holgate MVP & Adobe Community Professional

          I'm sure it would be possible to add those abilities to Flash Pro, but I doubt there is ever a case where a canvas export would be the only thing that page does. The ways to set its position are either to put the canvas into a div, and position that, or use a CSS style for the canvas.

           

          One thing I tend to do is to take the initial exported HTML from Flash Pro, rename it, add the various other page features that I'll need (loading animation gif, positioning, trapping for touch device scrolling, adjusting the number of simultaneous downloads in preloads, etc). Then when I test movie I can see how things are going, but its the duplicate with all the extra bits I use for deployment.

          • 2. Re: Flash CC HTML5 Canvas margins and padding
            Ylazy Level 1

            It's quite easy. Add this code to first key frame:

            var bodyStyle = document.body.style;

              bodyStyle.margin = 0;

              bodyStyle.padding = 0;