3

Apparently, the new ActionScript Compiler 2.0 no longer supports the old [frame] metatag which allowed you to add preloaders to pure actionscript projects.

I've verified this IntelliJ - switching the "Prefer ActionScript Compiler 2.0 for pure ActionScript build configurations" makes a difference between the preloader being instantiated and executed, and the main class being instantiated and executed.

Googling yield no result, so is there currently any way around this issue - use ASC2.0 but have the benefits of the Frame metatag?

Maurycy
  • 1,324
  • 1
  • 11
  • 33
  • I've recently started using ActionScript Compiler 2.0, and I haven't encountered this issue. I use the commandline tool `mxmlc`, and the `-frame` parameter (seems to be) working as before. Since you're talking about a pure ActionScript project, `mxmlc` should be an option for you too (unless it actually is being ignored and somehow my project is still working!) – Dave Apr 10 '13 at 16:48
  • @Dave I am using the frame metatag, maybe that's the reason? Can you post exactly what you type for the "-frame" command-line parameter? – Maurycy Apr 10 '13 at 19:23
  • 1
    I run it like this `mxmlc Loader.as -frame=ContentFrame,Main`, which makes Loader.as into frame 1 and Main.as goes on a frame labelled `ContentFrame`. I actually don't use ContentFrame though, instead I wait until the SWF has loaded and use `new (getDefinitionByName( "Main" ) as Class)( )` to create an instance of it within the Loader's class. It means that I get more control over animations. – Dave Apr 10 '13 at 22:24
  • @Dave Can you please post the way you do it as an answer? I've just checked and it seems to work with the -frame compiler option. – Maurycy May 03 '13 at 12:51
  • OK, I posted it. I guess this question is answered, but the better solution would be for Adobe to re-add the meta tag! – Dave May 03 '13 at 17:08
  • @Dave Thanks for adding it, marked it as correct. Maybe one day they will add it... Or notice that there is something not exactly right with it :). – Maurycy May 03 '13 at 17:26

1 Answers1

2

This still works when using the mxmlc commandline tool;

mxmlc Loader.as -frame=ContentFrame,Main

(produces a 2-frame SWF; the first has no name and contains Loader, the second is named ContentFrame and contains Main).

Dave
  • 44,275
  • 12
  • 65
  • 105
  • Just to clarify, the second argument to `-frame` must be a fully qualified class name, e.g. `-frame=ContentFrame,com.example.Main` unless of course your `Main` class is in the root namespace. :) – Jeff Ward Dec 09 '14 at 15:36