On 1/19/17, 12:40 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira"
<carlos.rov...@gmail.com on behalf of carlos.rov...@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
>me.

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...
-Alex

Reply via email to