3 Replies Latest reply on Apr 18, 2013 2:46 PM by grandascreativos

    Can I have unique function and variable names with createjs when publsihing from Flash?

    DjPhantasy5

      Hey everyone!

       

      I have recently started using the Toolkit for CreateJS exporter for turning small button icon animations, made in Flash, into content for HTML5. I have created 3 seperate icon '.fla' files that animate when rolled over.

      With this example tag added into my html5 document, the animation works fine:

       

      <canvas id="about_btn" width="85" height="70" style="background-color:#FFF"></canvas>

       

      However, once I have added more than one canvas tags, only one icon would appear on screen:

       

      <canvas id="about_btn" width="85" height="70" style="background-color:#FFF"></canvas>

      <canvas id="news_btn" width="85" height="70" style="background-color:#FFF"></canvas>

      <canvas id="contact_btn" width="85" height="70" style="background-color:#FFF"></canvas>

       

      I found out that the JavaScript files that were generated with each '.fla' file were conflicting because they were all using the same variable and function names (ex. stage, canvas, init(), etc.). Is there a way for me to publish the JavaScript from Flash with document specific variable and function names? (ex. about_stage, about_canvas, about_init())

       

      A work around methood that I can currently using is putting each <canvas> tag into it's own iFrame.

       

      Thanks again for the help!

      -DJ