问题
so I have a lot of classes in actionscript 2. But I need to modify my application to use the soundchannel object for audio monitoring. as far as i know this is only in actionscript 3. so it it possible to write one class in AS3 and leave the rest in AS2?
if not is there a conversion tool which can make the process easier?
回答1:
The language the ActionScriptBridge site uses is sort of misleading: "Use flash AS2.0 flash components in AS3.0 projects." And then tells you how it works: "Technically: Load Macromedia/Adobe Flash AS2.0 projects (swf) inside Adobe Flash AS3.0 projects using ASB and communicate between them.".
You'd have to compile two separate swfs in the ActionScriptBridge case. One for AVM1 bytecode (as2) and one for AVM2 (as3). You can also use LocalConnection to communicate between two swfs that are different AVMs. There is no way to compile 2 & 3 together (unless maybe you wrote your own compiler ;))
Here's a nice post on Senocular explaining the LocalConnection and the AVM: http://www.kirupa.com/forum/showthread.php?p=1964550. The key here being
What that boils down to is that ActionScript 3 cannot talk to AS1 or AS2 - at least not directly.
回答2:
You could look at this bridge project: ActionScriptBridge but otherwise I don't believe there is any way to run as2 & as3 concurrently. Also there have been some attempts as making as2 -> as3 converters, but none are that stable or reliable.
来源:https://stackoverflow.com/questions/1614293/actionscript-2-to-actionscript-3