![MACROMEDIA Flash Lite 2 Скачать руководство пользователя страница 202](http://html1.mh-extra.com/html/macromedia/flash-lite-2/flash-lite-2_reference_687553202.webp)
202
ActionScript language elements
The following example uses an
if
statement to evaluate how long it takes a user to click the
submit_btn
instance in a SWF file. If a user clicks the button more than 10 seconds after the
SWF file plays, the condition evaluates to
true
and the message inside the curly braces (
{}
)
appears in a text field that's created at runtime (using
createTextField()
). If the user clicks
the button less than 10 seconds after the SWF file plays, the condition evaluates to
false
and
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 "+dif"
seconds.";
}
else {
this._parent.message_txt.text = "Very good, you hit the button in
"+dif" seconds.";
}
};
See also
else statement
implements statement
myClass
implements
interface01
[,
interface02
, ...]
Note:
To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in
the Flash tab of your FLA file's Publish Settings dialog box. This keyword is supported only
when used in external script files, not in scripts written in the Actions panel.
Specifies that a class must define all the methods declared in the interface (or interfaces) being
implemented.
Availability:
ActionScript 2.0; Flash Lite 2.0
Example
See
interface
.
See also
class statement
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...