flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark goldin <markzolo...@gmail.com>
Subject Re: Data type changes at compile time???
Date Mon, 27 Apr 2015 17:36:46 GMT
Ah, I see. That explains, thanks.

On Mon, Apr 27, 2015 at 12:29 PM, OmPrakash Muppirala <bigosmallm@gmail.com>
wrote:

> Data type technically does not change because all instances are of type
> Object by default.   If the class definition is available and the server
> side object has class metadata included,  it will be automatically cast to
> the correct type by the Flash player.
> On Apr 27, 2015 10:18 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
>
> > But why data type changes before second statement gets hit?
> >
> > On Mon, Apr 27, 2015 at 12:15 PM, OmPrakash Muppirala <
> > bigosmallm@gmail.com>
> > wrote:
> >
> > > In the second case, the definition of the class someVO will be included
> > in
> > > the compiled swf,  because it appears in the code.
> > >
> > > In the first case,  the compiler has no knowledge that someVO would be
> > > used.
> > >
> > > Just declaring a dummy object of type someVO at the top of the class
> > would
> > > ensure that the compiler includes that class definition in the swf.
> > >
> > > Thanks,
> > > Om
> > > On Apr 27, 2015 9:55 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
> > >
> > > > I have the following code:
> > > > public function result(data:Object):void
> > > > {
> > > >      // Check data.result
> > > >      trace(data.result[0]); I see data type Object
> > > >      // but if I add this code:
> > > >      trace(data.result[0] as someVO); then at the first trace I see
> > data
> > > > type as of someVO
> > > > }
> > > >
> > > > How can run time know that I am about to cast data?
> > > >
> > > > Thanks
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message