Hi guys im completely new to this so go easy


basically i'm trying function add 1 variable , when variable hits certian number want go different page. heres code ive come with

 

 

var hit:number=0;

 

 

cymbol2.addeventlistener(mouseevent.click, drumbeat);

kick2.addeventlistener(mouseevent.click, drumbeat);

 

function drumbeat (event:mouseevent) :void {hit=+1}

 

 

function checkpage(e:event):void {

    if (hit==3) {

        gotoandplay("bedroom1");

    }

}

 

any appreciated

use:

 

 

 

var hit:number=0;

 

 

cymbol2.addeventlistener(mouseevent.click, drumbeat);

kick2.addeventlistener(mouseevent.click, drumbeat);

 

function drumbeat (event:mouseevent) :void {

hit+=1;

checkpage(e);

}

 

 

function checkpage(e:event):void {

    if (hit==3) {

        gotoandplay("bedroom1");

    }

}

 

 



More discussions in ActionScript 3


adobe

Comments