0 Replies Latest reply on Apr 19, 2015 7:32 AM by jafproductions

    Integrating Edge animation into an html project

    jafproductions Level 1

      I have a quiz created in javascript and CreateJS, and I have intros for each section created in Adobe Edge.

      I have the main quiz in a Canvas div (<canvas id="mainCanvas" width="1280" height="720">  )

      And I have a div for the Edge animation  <div id="Stage" class="EDGE-4024456"></div>

       

      I am able to activate the Edge animation by doing:

      $('#Stage').show();

      $('#mainCanvas').hide();

       

      When the Edge animation ends a button comes up.

      In the button handler I am able to hide the Edge animation with:

      sym.$("Stage").hide();

       

      However I am not able to make the mainCanvas visible again.

      I assume it's because the mainCanvas is out of the current scope that the button handler is in. I tried many different ways to access the root or parent element but I can't get it to work.

       

       

       

       

       

      This is my main html:

       

      <!doctype html>

      <html class="no-js" lang="">

          <head>

              <meta charset="utf-8">

              <meta http-equiv="X-UA-Compatible" content="IE=edge">

              <title>Burst Training</title>

              <meta name="description" content="">

              <meta name="viewport" content="width=device-width, initial-scale=1">

             

             

              <script src="lib/jquery-1.11.1.min.js"></script>

              <script src="lib/jquery-ui.js"></script>

              <script src="lib/edge.1.0.0.min.js"></script>

              <script src="lib/easeljs-NEXT.combined.js"></script>

              <script src="lib/preloadjs.js"></script>

              <script src="js/plugins.js"></script>

              <script src="js/jafLib.js"></script>

              <script src="js/Hover.js"></script>

              <script src="js/Button.js"></script>

              <script src="js/ToggleButton.js"></script>

              <script src="js/Dropdown.js"></script>

              <script src="js/ClickAndDrag.js"></script>

              <script src="js/main.js"></script>

           <!--   <script>

               yepnope({load: "http://simonwidjaja.github.com/EdgeCommons/live/EdgeCommons-0.7.1.min.js"}); 

              </script>-->

              <!--Adobe Edge Runtime-->

              <script type="text/javascript" charset="utf-8" src="animations/section1/Scenario-1_edge.js"></script>

              <style>

              .edgeLoad-EDGE-4024456 { display:none; }

              </style>

              <!--Adobe Edge Runtime End-->

              <link rel="stylesheet" href="css/main.css" type="text/css" media="screen" charset="utf-8">

       

          </head>

       

          <body>

               <div id="mainContainer">

                             

                  <canvas id="mainCanvas" width="1280" height="720">   

                  </canvas>

       

                   <div id="loadingScreen">

                      <div id="loadingmessage"></div>

                  </div>

                  <!--

                  <div id="animationScreen" style="width:100%;height:100%;"></div>

                  -->

                 

                  <div id="Stage" class="EDGE-4024456"></div>

       

              </div>

          </body>

      </html>

       

       

       

      This is the button handler code in Adobe Edge.

      (Including stuff I tried that fails)

       

      console.log("pause button clicked");

       

      sym.stop();

       

      // Pause an audio track

      sym.$("_1_-_Receiving_Emails_v22")[0].pause();

       

      // Show an element

      sym.$("play-button").show();

       

      //var div = document.getElementById("mainCanvas");

      //div.show();

      //sym.getComposition().getStage().getSymbol("symbolName1").getSymbol("symbolName2").play(0 );

      //sym.getComposition().getSymbol("mainCanvas").show();

      //sym.getSymbol("#mainCanvas").show();

       

      sym.$("Stage").hide();

      sym.$("mainCanvas").show();

      sym.$("#mainCanvas").show();

       

      var s = sym.getParentSymbol(); //valid object

      s = document.documentElement; //valid object

       

      console.log("1="+s);

       

      //error

      //s = sym.$("Stage").getParentSymbol();

      s = s.getSymbol("mainCanvas"); //js error

      console.log("2="+s);

       

      s.show();

      //s = sym.getComposition().getSymbol("mainCanvas");

       

      console.log("3="+s);