I tested the HTML5 version and it is possible to use a frame script, such as simple stop(), gotoAndPlay(), and the C++ target is unresponsive; I hope the C++ target can support simple statements such as stop(). Is there any good idea?
I saw the source code of openfl.display.MovieClip. I modified some simple commands that support C++.
I saw support for using hscript in the source code. It has been used normally. It’s great.
Did you need to make any changes/tweaks in the sources? If so, could you share them with us?
Are you using scripts written in the SWF, now, or are you using clip.addFrameScript
?
Yes! I just used the Haxelib library hscript, which was originally supported by OpenFL, but in order to meet some methods, such as callback events, I modified some type support so that it can directly edit the script in Adobe Animate. These are the hscripts that are already done. They are great.
#if hscript
if (parser == null) {
parser = new Parser ();
parser.allowTypes = true;
}
var program = parser.parseString (frameData.scriptSource);
var interp = new Interp ();
interp.variables.set ("this", this);
//自定义支持
interp.variables.set ("flash.events_Event", Event);
var script = function () {
interp.execute (program);
};
__frameScripts.set (frame, script);
#elseif js
Adobe Animate Code:
import flash.events.Event;
stop();
this.dispatchEvent(new Event("gameOver2",true));