Actually, now I'm really confused.  The line that's actually failing
is this:

if (_init == null) //from getBoolean()

Why would _init being null trigger a ReferenceError: Error #1065:
Variable _init is not defined?




On Feb 20, 1:26 am, Craig Murray <[email protected]> wrote:
> Now that I'm stuck on new View3D(); I'm reading the away source and I
> dont see how this is ever supposed to work.
>
> Considering the following code:
>
> public class Init
>     {
>                 /** @private */
>         arcane var _init:Object;
>
>         public function Init(init:Object)
>         {
>             this._init = init;
>         }
>
>         public static function parse(init:Object):Init
>         {
>             if (init == null)
>                 return new Init(null);
>             if (init is Init)
>                 return init as Init;
>
>             inits.push(init);
>             return new Init(init);
>         }
>
> plus this code inside View3D's ctor:
>
> _ini = Init.parse(init) as Init;
> var stats:Boolean = _ini.getBoolean("stats", true);
>
> If I call new View3D() this is necessarily going to dereference null.
>
> What is going on?
>
> On Feb 20, 1:01 am, Craig Murray <[email protected]> wrote:
>
> > So I just bought The Essential Guide to 3D in Flash (isbn
> > 978-1-4302-2541-6) and so far I am extremely disappointed.
>
> > Here is a list of problems I've had in my first 30 minutes with the
> > book:
>
> > 1. Publisher claims source code is available for download atwww.apress.com
> > but ISBN is "not found" and book is not listed
>
> > 2. The very first piece of source code listed in the book has a typo
> > which caused a compile error (var view:View3D then later
> > addChild(_view);
>
> > 3. That same first piece of code has a runtime error during
> > construction of the View3D (using the latest trunk of fp10 code line)
>
> > ReferenceError: Error #1065: Variable _init is not defined.
> >         at away3d.core.utils::Init/getBoolean()[C:\_projects\away3d
> > \fp10\Away3DLib\src\away3d\core\utils\Init.as:114]
>
> > For a book that was written by a primary developer on the project, I
> > expected more.

Reply via email to