Flash AS3-Taste Drücken und gedrückt Halten

Ich bin kein Experte in Flash aber ich fand einen Weg in AS2, um eine "drücken und halten" - Taste. Jetzt arbeite ich mit AS3 und ich möchte diesen code umgewandelt werden AS3. Kann mir da jemand helfen ?

stop();

function startTimer(mc, conversionTime) {
    mc.onEnterFrame = function() {
        if ((getTimer() / 1000) - conversionTime > 1) {
            delete this.onEnterFrame;
            gotoAndStop(3);
        }
    };
}
button1.onPress = function() {
    var conversionTime:Number = getTimer() / 1000;
    startTimer(this, conversionTime);
    this.onRelease = function() {
        if (this.onEnterFrame != null) {
            gotoAndStop(2);
        }
        delete this.onEnterFrame;
    };
};

Dank !

InformationsquelleAutor user1418141 | 2012-05-25
Schreibe einen Kommentar