Im still new to this whole game setup so im posting the code on the forums.
I figured out a way to add paste support to the game using ffdec
This this is the code in human readable format. file is GameTextModule.
after opening the swf go to `GameTextModule` in `classes.UIComponents.ContentModules`.
use the add trait button and add a `pasteEvent` method.
edit its pcode and replace it with.
In the function Build add this pcode.
I figured out a way to add paste support to the game using ffdec
This this is the code in human readable format. file is GameTextModule.
Code:
this._textInput.visible = false;
this._textInput.addEventListener(Event.PASTE,this.pasteEvent);
}
Code:
private function pasteEvent(param1:Event) : void
{
this._inputText.text = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;
}
after opening the swf go to `GameTextModule` in `classes.UIComponents.ContentModules`.
use the add trait button and add a `pasteEvent` method.
edit its pcode and replace it with.
Code:
trait method Qname(PrivateNamespace("classes.UIComponents.ContentModules:GameTextModule"),"pasteEvent")
dispid 0
method
name "classes.UIComponents.ContentModules:GameTextModule/private:pasteEvent"
flag HAS_PARAM_NAMES
param Qname(PackageNamespace("flash.events"),"Event")
paramname "e"
returns Qname(PackageNamespace(""),"void")
body
maxstack 1
localcount 2
initscopedepth 10
maxscopedepth 11
code
getlocal_0
pushscope
getlocal_0
getproperty Qname(PrivateNamespace("classes.UIComponents.ContentModules:GameTextModule"),"_inputText")
getlex Qname(PackageNamespace("flash.desktop"),"Clipboard")
getproperty Qname(PackageNamespace(""),"generalClipboard")
getlex Qname(PackageNamespace("flash.desktop"),"ClipboardFormats")
getproperty Qname(PackageNamespace(""),"TEXT_FORMAT")
callproperty Qname(PackageNamespace(""),"getData") 1
getlex Qname(PackageNamespace(""),"String")
astypelate
coerce_s
setproperty Qname(PackageNamespace(""),"text")
returnvoid ; trait
end ; code
end ; body
end ; method
end ; trait
Code:
getlocal_0
getproperty Qname(PrivateNamespace("classes.UIComponents.ContentModules:GameTextModule"),"_textInput")
findpropstrict Qname(PackageNamespace("flash.events"),"Event")
getproperty Qname(PackageNamespace("flash.events"),"Event")
getproperty Qname(PackageNamespace(""),"PASTE")
getlocal_0
getproperty Qname(PrivateNamespace("classes.UIComponents.ContentModules:GameTextModule"),"pasteEvent")
callproperty Qname(PackageNamespace(""),"addEventListener") 2
Last edited: