flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Dufilie <andy.dufi...@gmail.com>
Subject Re: [FlexJS] Issues with casting to an Interface
Date Mon, 21 Mar 2016 14:08:33 GMT
Which version of FlexJS are you using?
There were bugs with the cross-compiled "as" and "is" operators in 0.5.0
and older versions, but it should work correctly in the nightly build.

In this particular case, you can remove the "as IViewMyInitialView" in the
"get view()" function [1] since it's not needed.

[1]
https://gist.github.com/ok-at-github/8c4b94817fde72202231#file-main-mxml-L84

On Mon, Mar 21, 2016 at 6:55 AM, OK <OKrueger@edscha.com> wrote:

> Hi,
> I continue exploring FlexJS and have following issue wich is hard to
> explain
> for me:
>
> I would like to decouple the view from the rest of my app using interfaces.
> With the swc version all works fine, with the js versions it doesn't (0
> errors, 0 warnings).
> It seems to me that the js version doesn't like it if an interface is given
> instead of the view that implements this interface. As soon as I try to
> cast
> to an interface the js version refuse to work.
> Perhaps at least it makes no sense to cast to an interface?
>
> I have the following parts:
>
> Main.mxml:
> The application file that put it all together.
> At applicationComplete event the method setData() is called tree times.
>
> MyInitialView.mxml:
> A minimial view that implements IViewMyInitialView.as
>
> IViewMyInitialView.as:
> An interface that contains only one method declaration:
> setData(data:String):void
>
> TestClass.as:
> Expects the interface as constructor argument and implements a getter that
> returns it
>
> I pasted all parts with its code into one gist cause probably the code is
> better formatted there:
> https://gist.github.com/ok-at-github/8c4b94817fde72202231
>
> Thanks for reading and sorry for posting so much probably confusing text. I
> tried to reduce it all as best as I can.
>
> Any ideas?
>
> Thanks,
> Olaf
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Issues-with-casting-to-an-Interface-tp12299.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

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