Hi-

Thanks, but the AS operator results in a NULL because the conversion fails(!!).

Bottom line: AS operator does not work for this problem ...

Naga

--- In [email protected], "Chuck Preston" <itsmechuckjr@...> wrote:
>
> I don't know the reason why objects lose their type sometimes, but I know 
> that when it does happen, the solution is to retype them. In your case, you'd 
> have to do something in your first view like: var modelLocator:ModelLocator = 
> data as ModelLocator;
> 
> 
> --- In [email protected], "nagaofthesea" <nagaofthesea@> wrote:
> >
> > Howdy-
> > 
> > I have used (my customized) Cairngorm 2.0 and Flex 4.5.1 to build my first 
> > iOS + Andorid app.  Launched and available at iTunes and Android Market 
> > without a hitch.
> > 
> > I am building another flavor of the same app and BAM! type conversion error 
> > with the passing of the data object!!  What??
> > 
> > ViewNavigatorApplication.firstViewData is passed the ModelLocator when the 
> > app starts.  When I inspect the variables, the parentDocument.firstViewData 
> > is strongly typed to ModelLocator.
> > 
> > HOWEVER, when the View gets finally gets passed the "data", View.data is 
> > typed as Object -- not strongly-typed ModelLocator.
> > 
> > I double-checked with my published app and the View.data is always the 
> > strongly-typed ModelLocator -- which is the expected behavior.
> > 
> > Anybody know what gives / how to correct this fluky behavior?  
> > 
> > The error output is worthless - just the generic #1034 pointing to the 
> > addHandler that tries to cast the View.data to the ModelLocator.  As the 
> > app is just starting up, all of the preceding lines are pointing to 
> > framework code only.
> > 
> > This is kindofa pain in the arse, because I just can't see why the "data" 
> > property looses its strong type....
> > 
> > Regards,
> > Naga
> >
>


Reply via email to