As I find out from source code it was an error in the book.
Instead of
Code:
private function onFileOpenSelect( event: FileEvent) : void
{
currentFile = event.file as File;
openFile();
}
should be
Code:
private function onFileOpenSelect( event: Event) : void
{
currentFile = event.target as File;
openFile();
}
and instead of
Code:
private function onFileSaveSelect( event: FileEvent) : void
{
currentFile = event.file as File;
textChanged = false;
title = "Text Editor - " + currentFile.name;
saveFile();
}
should be
Code:
private function onFileSaveSelect( event: Event) : void
{
currentFile = event.target as File;
textChanged = false;
title = "Text Editor - " + currentFile.name;
saveFile();
}
I'm submitting this for Errata as an error if someone here at Wrox care about it. Thanks