5.
In FlashPaper.as, type the following ActionScript code into the Script window:
class FlashPaper implements IDocumentation {
}
6.
Save the changes that you made to the ActionScript file.
7.
Click the Check Syntax button for your ActionScript class.
You see an error that's similar to the following message:
**Error** path\FlashPaper.as: Line 1: The class must implement method
'checkForUpdates' from interface 'IDocumentation'.
class FlashPaper implements IDocumentation {
Total ActionScript Errors: 1
This error appears because the current FlashPaper class doesn't define any of the public
methods that you defined in the IDocumentation interface.
8.
Open the FlashPaper.as class file again and modify the existing ActionScript code so that
it matches the following code:
class FlashPaper implements IDocumentation {
private static var __version:String = "1,2,3,4";
public function downloadUpdates():Void {
};
public function checkForUpdates():Boolean {
return true;
};
public function searchHelp(keyword:String):Array {
return []
};
}
9.
Save your changes to the ActionScript file, and then click Check Syntax again.
This time you don't see any errors appear in the Output panel.
You can add as many additional static, public, or private variables or methods as you
want to the FlashPaper class file. The interface file defines only a set of minimum
methods that must appear within any class that implements that interface.
10.
Open the IDocumentation interface document again, and add the following boldface line
of code (below the
interface IDocumentation {
public function downloadUpdates():Void;
public function checkForUpdates():Boolean;
public function searchHelp(keyword:String):Array;
public function addComment(username:String, comment:String):Void;
}
322
Interfaces
Reported Errors: 1
method):
searchHelp()
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?