Wrox Programmer Forums
|
BOOK: Adobe AIR: Create - Modify - Reuse ISBN: 978-0-470-18207-9
This is the forum to discuss the Wrox book Adobe AIR: Create - Modify - Reuse by Marc Leuchner, Todd Anderson, Matt Wright; ISBN: 9780470182079
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Adobe AIR: Create - Modify - Reuse ISBN: 978-0-470-18207-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2009, 04:46 PM
Authorized User
 
Join Date: Jan 2009
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default Error during program execution (Ch 2 Text Editor)

I'm working on the Text Editor example and when I try to run program in order to save new or open existing file I'm getting error

TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@8b4d971 to mx.events.FileEvent.

I'm not working in Air SDK, instead I'm using Flex Builder 3

Any ideas? Thanks
 
Old January 27th, 2009, 03:35 PM
Authorized User
 
Join Date: Jan 2009
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default Error in the book

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem during execution of php program greenday Beginning PHP 2 November 12th, 2007 04:51 PM
Ch. 7 - Managing Reports Using Program Code MER78 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 September 27th, 2004 08:15 AM
Problems with the editor example in ch 10 arne Beginning PHP 4 August 21st, 2004 02:24 PM
How to terminate program execution without "End" pavel Beginning VB 6 2 September 2nd, 2003 06:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.