The following example uses an
instance in a SWF file. If a user clicks the button more than 10 seconds after the
submit_btn
SWF file plays, the condition evaluates to
appears in a text field that's created at runtime (using
the button less than 10 seconds after the SWF file plays, the condition evaluates to
a different message appears.
this.createTextField("message_txt", this.getNextHighestDepth, 0, 0, 100,
22);
message_txt.autoSize = true;
var startTime:Number = getTimer();
this.submit_btn.onRelease = function() {
var difference:Number = (getTimer() - startTime) / 1000;
if (difference > 10) {
this._parent.message_txt.text = "Not very speedy, you took "+difference+"
seconds.";
}
else {
this._parent.message_txt.text = "Very good, you hit the button in
"+difference+" seconds.";
}
};
See also
else statement
implements statement
myClass implements interface01 [, interface02 , ...]
Specifies that a class must define all the methods declared in the interface (or interfaces) being
implemented.
Availability: ActionScript 2.0; Flash Player 6
Example
See
.
interface
See also
class statement
216
ActionScript language elements
statement to evaluate how long it takes a user to click the
if
and the message inside the curly braces (
true
createTextField()
)
{}
). If the user clicks
and
false
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?