flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [1/2] flex-asjs git commit: A temp way to get Application reference. Don’t like this solution and at minimum we should have a FlexGlobals.topLevelApplication or something like that
Date Thu, 19 Jan 2017 16:00:07 GMT

On 1/19/17, 12:40 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Good suggestion Piotr,
>Maybe create a Application subclass only to get a static var is not the
>best way. In the other hand is the way is implemented in other libs like
>CreateJS, Express...
>and could lead to be more MDL Specific... Right now both ways are ok for

IMO, the bead you are looking for could be coded something like this:

public class GlobalApplicationReference implements Ibead
    public static var application:Application;

    public function set strand(value:IStrand):void
        application = value as Application;

The question is, what should the type of the application variable be?  If
it is ApplicationBase, it can be used in many places, but it won't have
the "initialView" property.  If you need to access variables declared on
your specific MXML app, then you would need to cast it, or create a custom
version of such a bead.

Of course, I could be wrong...

View raw message