zählen Klicks verwenden von actionscript 3.0 in flash

Will ich ändern den Wert der Variablen auf der Grundlage der Anzahl der Klicks.

So, wenn Sie klicken Sie auf die Taste einmal, die Kontos sollte gleich 1 und zweimal sollte es gleich 2.

Jetzt bin ich wieder der Wert 0 ist, egal wie viele Klicks.

Irgendwelche Ideen?

btnRaw.addEventListener(MouseEvent.CLICK, flip);
btnRaw.addEventListener(MouseEvent.MOUSE_UP,count);
//create the flipping function

//create the variable to store the click count
var cCount:Number = 0;

function flip(Event:MouseEvent):void{
    raw_patty_mc.gotoAndPlay(1);
}

function count(Event:MouseEvent):void{
    cCount = cCount+1;
    if(cCount>3 || cCount<6){
        titleText.text="See you're doing a great job at flipping the burger! "+String(cCount);
    }
}

InformationsquelleAutor Michael Stone | 2010-03-17

Schreibe einen Kommentar