MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 326

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

16.
In classdTest.fla, add the following ActionScript code on Frame 1 of the Timeline:
// filename: classdTest.fla
import ClassD;
var myD:ClassD = new ClassD();
trace(myD.k()); // 15
trace(myD.n(7)); // 49
myD.o(); // o
17.
Save your changes to the classdTest.fla file and then select Control > Test Movie to test the
file.
The values 15 and 49 and the letter o should be displayed in the Output panel. These
values are the results of the
respectively.
18.
Create a new ActionScript document and save it as InterfaceC.as.
This interface extends the InterfaceA interface you created earlier, and it adds a new
method definition.
19.
In InterfaceC.as, type the following ActionScript code into the Script window:
// filename: InterfaceC.as
interface InterfaceC extends InterfaceA {
public function p():Void;
}
20.
Save your changes to the ActionScript file and then create a new ActionScript file and save
it as ClassE.as in the complexInterface directory.
This class implements two interfaces, InterfaceB and InterfaceC.
21.
In ClassE.as, type the following ActionScript code into the Script window:
// filename: ClassE.as
class ClassE implements InterfaceB, InterfaceC {
public function k():Number {
return 15;
}
public function n(z:Number):Number {
return (z + 5);
}
public function o():Void {
trace("o");
}
public function p():Void {
trace("p");
}
}
22.
Save your changes to the ActionScript document, and then create a new Flash document
and save it as classeTest.fla in the complexInterface directory.
326
Interfaces
method,
ClassD.k()
, and
ClassD.n()
ClassD.o()
methods,

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents