Flash, javascript and Html5 canvas

Asked

Viewed 107 times

1

Hi I slider in flash player with Html5 canvas and published now I need to put it inside the div of my file but I’m not getting, the screen turns black when I replace the html file made by flash, and put in my page. I’m testing it on a local server, maybe that’s why? I did a test and put inside an iframe and it worked more for an e-commerce I think it would not be good to use iframes for the sliders of the pages.

This is the html and javascript code that the cc flash created that I want to put inside my div

     <!DOCTYPE html>
     <html>
     <head>
     <meta charset="UTF-8">
     <title>slider</title>

     <script src="http://code.createjs.com/easeljs-0.8.1.min.js"></script>
     <script src="http://code.createjs.com/tweenjs-0.6.1.min.js"></script>
     <script src="http://code.createjs.com/movieclip-0.8.1.min.js"></script>
     <script src="http://code.createjs.com/preloadjs-0.6.1.min.js"></script>
     <script src="slider.js"></script>

     <script>
     var canvas, stage, exportRoot;

        function init() {
           canvas = document.getElementById("canvas");
         images = images||{};
         ss = ss||{};

         var loader = new createjs.LoadQueue(false);
         loader.addEventListener("fileload", handleFileLoad);
         loader.addEventListener("complete", handleComplete);
         loader.loadFile({src:"images/slider_atlas_.json",         type:"spritesheet", id:"slider_atlas_"}, true);
         loader.loadManifest(lib.properties.manifest);
     }

     function handleFileLoad(evt) {
         if (evt.item.type == "image") { images[evt.item.id] = evt.result; }
     }

     function handleComplete(evt) {
         var queue = evt.target;
         ss["slider_atlas_"] = queue.getResult("slider_atlas_");
         exportRoot = new lib.slider();

         stage = new createjs.Stage(canvas);
         stage.addChild(exportRoot);
         stage.update();
         stage.enableMouseOver();

         createjs.Ticker.setFPS(lib.properties.fps);
         createjs.Ticker.addEventListener("tick", stage);
     }
     </script>
     </head>

     <body onload="init();" style="background-color:#D4D4D4">
         <canvas id="canvas" width="1200" height="720" style="background-color:#000000"></canvas>
     </body>
     </html>

If anyone knows anything that might help, I’d appreciate it! Thank you.

  • Post page code and slider code, to try to reproduce your problem.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.