var Total:int=0 from AS3 to HTML5 Canvas
Hello everyone,
I am making the transition from Flash AS3 to Flash HTML5 Canvas. I have been creating interactive children's educational games using Flash and AS3 for years, and I am now trying to do the same with Flash HTML5 Canvas. I am very stuck on how to achieve this same interactivity in Flash HTML5 Canvas. Here is the code I used in AS3:
var totalButtons:int = 0;
button1.addEventListener(MouseEvent.CLICK, Press1Button);
function Press1Button(e:Event):void
{
totalButtons++;
if (totalButtons == 3)
{
MovieClip(root).takeoff.gotoAndPlay(2);
}}
button2.addEventListener(MouseEvent.CLICK, Press2Button);
function Press2Button(e:Event):void
{
totalButtons++;
if (totalButtons == 3)
{
MovieClip(root).takeoff.gotoAndPlay(2);
}}
button3.addEventListener(MouseEvent.CLICK, Press3Button);
function Press3Button(e:Event):void
{
totalButtons++;
if (totalButtons == 3)
{
MovieClip(root).takeoff.gotoAndPlay(2);
}}
I can successfully control Button behaviors using Javascript directly in the timeline, however adding variables with Javascript is still confusing me. I have been trying to manipulate some code that I learned in an HTML5 Edge tutorial, however it is not working in my Flash HTML5 Canvas document and that is platform I will be using (it seems to be most similar to Flash as far adding and animating artwork).
Thanks in advance!!
