flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Tynjala <joshtynj...@gmail.com>
Subject Re: Static initialization
Date Mon, 20 Mar 2017 21:53:54 GMT
I know you can call static functions from inside the package block. Simply
put your loop inside the static function. Here's a simpler example that you
should be able to modify to add your loop:


It's certainly possible that FalconJX will mangle this code when emitting
the JS. If that's the case, it's a bug.

- Josh

On Mon, Mar 20, 2017 at 2:43 PM, Harbs <harbs.lists@gmail.com> wrote:

> Is there a good way to initialize static variables?
> I have a class which has a large static object and I need to initialize
> about 100 attributes in a loop. It’s actually a class being ported from
> Javascript. In Javascript, it’s pretty easy to do this. You just write the
> loop right after declaring the variable. I’m not sure how to go about it in
> AS though…
> (I have a feeling this will be a common problem for code being migrated
> from JS to AS.)
> Thoughts?
> Harbs

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