Reputation: 38619
This problem has been bugging me, and I cannot find a straightforward answer on the Internets.
Let' say mxmlc
from Adobe's open-source Flex SDK 3.5 is being used. I typically want to develop some smaller graphical things, which I usually code in a single .as
file. Then:
.as
file, and compile it with mxmlc
, and get a .swf
out of it (as in Flash/ActionScript3 “Programming” under Ubuntu at William Brown Street)
swf
will not be playable with, say, Gnash
).mxml
file, and embed ActionScript into it (as in, say Flex 3 Example: Drawing a path at run time with adding and deleting points capabilities » MyLineRider)
CDATA[
- as I'm typically building anything on the screen programmatically from primitives; which is why, I don't care much for the mxml file - and I'd prefer a single .as
file to work with. And also, I think even this also works only in AS3.0 context Finally, I guess - in the past - it was possible to compile such single ActionScript 2.0 .as
files with mtasc
, as shown in Motion-Twin MTASC - Tutorial
To repeat - basically I want to use Flex/ActionScript as a vector drawing "script" engine, will work mostly with non-animated files and graphic primitives and text - and for this, I'd be most comfortable with a single .as
file; that I would compile from the command line, to obtain a swf
. However, I wouldn't want to write AS3.0 since then Gnash
couldn't open them (and also, I'd rather use the open-source flex sdk - than going to mtasc
for AS2.0 compilation).
So my questions boil down to:
.as
file, so they are compiled by Flex3's mxmlc
?mxmlc
in a single .mxml
file? mxmlc
to generate an .swf
for "older" Flash player (so that Gnash
would be able to read it?)
mxmlc -compiler.accessible HelloWorld_flex.as
', but that doesn't make the resulting SWF show in Gnash (in particular, at least text labels are missing)Well - any comments here will be appreciated (and especially, if there is a solution, a link to an example file :) ) ... I prefer AS2.0 for this task as it was easier (and for the kind of task, I don't really need the strict subclassing AS3.0 stuff) - but I wouldn't mind coding in AS3.0 - as long as I'm sure 'legacy' swf
players will be able to open the end result..
Thanks for any suggestions,
Cheers!!
PS: This may be an interesting link, similar to this problem - but even earlier (in respect to AS1): Adobe: Flash - command-line compile AS1 (-->FP6.0.65) code?
EDIT: Possibly a relevant quote: meetings:minutes_apr_18_2007 [ES Wiki]:
Pratap: Just as a data point Flash v9 ships with 2 VMs (for ActionScript2 and ActionScript3). (Jeff clarification: this is primarily because AS2 was less concerned with ES3 compatibility than AS3. We made a choice in AS3 to prefer ES3 compatibility over AS2 compatibility. Because ES4 is compatible by design with ES3, this particular motivation does not exist for an implementation of ES3 and ES4.)
Upvotes: 1
Views: 1014
Reputation: 120380
No, no and no. MXMLC creates only AVM2 compatible bytecode. This means AS2 is out. Period.
If you want to target AVM1 (the bytecode that GNASH can execute) you'll need to use either Flash IDE or MTASC (probably in the FlashDevelop IDE). Compared to any Adobe offering, MTASC coupled with FlashDevelop is awesome. For me, developing AVM1 SWF without FD/MTASC is pretty painful.
Upvotes: 1