Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command-line compile AS1 (-->FP6.0.65) code?

Status
Not open for further replies.

shadedecho

Programmer
Oct 4, 2002
336
0
0
US
I've been searching for a way to command-line compile (opensource-wise) AS1 code. The reason I need to do so is I've got a project that has a SWF that is compatible with the FP6.0.65 player to expose the ExpressInstall functionality, but I want to be able to let people re-compile the SWF without needing a copy of Flash.

I've looked at Ming, mtasc, and mxmlc. I couldn't really figure out what I needed to do with Ming. mtasc gave me errors (but I wasn't entirely certain that it couldn't work, I just didn't know how to get it to recognize the AS1 style code -- kept complaining about "System...", etc). mxmlc couldn't understand anything not in packages.

So, I was wondering if anyone can help me out. Is there a way to command-line compile a simple, single .as file (AS1) code into a SWF targeted for FP6?
 
kenn-
You have a good point (in that AS2 compiles back down to AS1 ultimately), but the overall goal is that I need for some AS file (regardless of syntax) to be able to be compiled to AS1 code that is sufficient to run in the 6.0.65 plugin version. This code exposes Adobe's "express-install" functionality, and must target that specific version as it was the first to introduce this ability.

It looks like "mtasc" should be able to compile AS2 code down to FP6 bytecode (though it also appears that the earliest it can target is 6.0.89, which is frustrating), but the question remains for me, if I "convert" the code into AS2 style code (not even sure exactly what minimum amount of work would be required for that), and use mtasc successfully, will I actually be creating a SWF that can run in the 6.0.65 player?

That's the crux of my issue.
 
I don't understand why you need to compile to FP6.0.65 - surely no one has that old player any more? ;)

That aside, if you want to know if MTASC compiled SWF can run on FP6.0.65, it's easy to test: just try it.

...in fact I just did that. It runs fine. But that's expected - there were not much differences between 6.0.65 and 6.0.79 (the last FP6, I think).

Kenneth Kawamoto
 
The reason for 6.0.65 is because that's what Adobe targetted and supports, and I want my solution to do the same.

Adobe's "Express Install" feature:
Also, if you'll note, the "Flash Player Detection Kit" that Adobe distributes, here:
Inside that archive, in the "Express Installation" subdir, you'll see the file "playerProductInstall.as", which is the basis actionscript (v1) file for "playerProductInstall.swf", which Adobe recommends you use to initiate the download of a new plugin payload.

SWFObject, and now my project, CheckPlayer, have extended this "playerProductInstall.as" file with slightly more enhanced (but still AS1 compatible) functionality, to use it as part of the "expressInstall.swf" feature set of our libraries.

So, Adobe, SWFObject, and now my project, CheckPlayer, all need to be able to provide a SWF which can run in FP6.0.65 at the bare minimum, in terms of targetting all possible end-users for FP plugin expressInstall upgrades. And being opensource projects as we are, I want/need to provide users an easy way to re-compile their own assets if they need/want to for some reason.

What I want to be able to do, independent of Adobe and SWFObject, for my project (for various opensource 'friendliness' reasons), is to provide instructions or a way where an end-user could re-compile the SWF in question using an opensource compiler (like mtasc) instead of requiring them to use the proprietary Flash IDE with the .FLA file.

------------------

It *is* an option for me to re-arrange the code in my .AS file to be "AS2-compatible" and then try to use mtasc to compile it, and I'm not averse to doing so.

But what I'm attempting to discover, before going down that route, is if mtasc will truly be able to take the converted AS2-compatible code and compile it back down to something that will run in the FP6.0.65 plugin, in the same way as I could use the Flash IDE to do the same.

MTASC.org seems to indicate they can target 6.0.89. I'm not sure if that's just an *example* of what versions you can target, or if that's the bare minimum version you can target with their tool.
 
I know MTASC site says 6.0.89 (by the way I can't find any reference to it on Adobe site - looks like 6.0.79 was the last FP6?) but as I said, I just compiled a test SWF which run on FP6.0.65 using MTASC. Looking at the version history ( I don't see anything obvious why this doesn't work. Of course one simple test SWF won't prove everything though... :)

Kenneth Kawamoto
 
Kenn-
Thank you, I appreciate you confirming for me that mtasc can target 6.0.65, that's what I needed to know. I'm glad to know that mtasc's site doesn't have the right info as to what FP version it can target at minimum. Perhaps they chose a non-existent (6.0.89) version on purpose, but it just led to more confusion on my part! :)

Do you have any suggestions on the best way for me to convert this file to AS2 syntax so that it'll compile with mtasc?
mtasc complains about the first code line, the one with "System" in it.
 
FYI, for posterity sake, I was able to accomplish this. There were some AS2 gotchas related to proper variable scoping when wrapping the functions in an object that mtasc could understand, but I got it to work. Unfortunately, it compiles to ~100 bytes larger than the strictly AS1 variant that the flash IDE compiles. But, that's a small price to pay for true open-source compilation. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top