My AIR app is loading an SWF file which contains a text field for input. I can type into the text field but copying and pasting is broken. When I try to paste something using the keyboard shortcut, the text field becomes like this:
(this is not a "T").
And after a series of copy/pasting it looks like this:
When I do a right-click on the text field, nothing happens, no context menu with copy/paste options appears.
The SWF that is being loaded is in AS2 (it's practically impossible to port it to AS3 because the code in it is very vast and sophisticated). I can't replace that SWF, it has extremely high value for my project. Apart from this trouble, the SWF works fine. Maybe I could change some config constants in the AS3 settings of the loader?
For testing purposes, I created two .flas, one is in AS2 and contains a text field and the other is in AS3 and loads the text field. You can download the .flas in an archive from here.
It's dirty hack, but it works. :) Convert your SWF from AVM1 to AVM2 "on fly". Use ForcibleLoader https://code.google.com/p/as3-classes/source/browse/trunk/org/lzyy/util/ForcibleLoader.as
In loader.fla:
var loader:Loader = Loader(addChild(new Loader()));
var fLoader:ForcibleLoader = new ForcibleLoader(loader);
fLoader.load(new URLRequest('tf.swf'));
In ForcibleLoader.as add import flash.system.LoaderContext;
and
var lc:LoaderContext = new LoaderContext();
lc.allowCodeImport = true;
loader.loadBytes(inputBytes, lc);
instead
loader.loadBytes(inputBytes);
in line ~75
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With