def abc_(i): abc = AbcFile() gen = abc.create_generator(False) for j in xrange(3): script_(gen, "ABC%d__Script%d" % (i, j)) gen.finish() return abc
swf.add_tag(tags.FileAttributes()) swf.add_tag(tags.EnableDebugger2()) swf.add_tag(tags.SetBackgroundColor(0x333333)) swf.add_tag(tags.DefineEditText(Rect(0, 0, 600, 400), "bb", "Testing script order.", color=RGBA(0xFFFFFF))) swf.add_tag(tags.PlaceObject2(1, 0)) abc = abc_(1) swf.add_tag(tags.DoABC("ABC1", abc)) abc = abc_(2) swf.add_tag(tags.DoABC("ABC2", abc, flags=1)) abc = abc_(3) swf.add_tag(tags.DoABCDefine(abc)) abc = AbcFile() gen = abc.create_generator(False) gen.context.new_script() with gen.Class("Main", packagedQName("flash.display", "Sprite")): with gen.Constructor(): print_(gen, "Main Constructor") gen.load("ABC0__Script0") gen.finish() swf.add_tag(tags.DoABC("Main", abc)) swf.add_tag(tags.SymbolClass({0:"Main"})) swf.add_tag(tags.ShowFrame()) swf.add_tag(tags.End()) f = open("script_order.swf", "wb") f.write(swf.serialize())
tags.DefineEditText(Rect(0, 0, 600, 400), "bb", "Testing script order.", color=RGBA(0xFFFFFF))) swf.add_tag(tags.PlaceObject2(1, 0)) abc = abc_(1) swf.add_tag(tags.DoABC("ABC1", abc)) abc = abc_(2) swf.add_tag(tags.DoABC("ABC2", abc, flags=1)) abc = abc_(3) swf.add_tag(tags.DoABCDefine(abc)) abc = AbcFile() gen = abc.create_generator(False) gen.context.new_script() with gen.Class("Main", packagedQName("flash.display", "Sprite")): with gen.Constructor(): print_(gen, "Main Constructor") gen.load("ABC0__Script0") gen.finish() swf.add_tag(tags.DoABC("Main", abc)) swf.add_tag(tags.SymbolClass({0: "Main"})) swf.add_tag(tags.ShowFrame()) swf.add_tag(tags.End()) f = open("script_order.swf", "wb") f.write(swf.serialize())
from mech.fusion.avm2.abc_ import AbcFile from mech.fusion.avm2.instructions import pushbyte abc = AbcFile() gen = abc.create_generator() gen.script0.make_init() gen.I(pushbyte(255)) abc.serialize() gen.finish() f = open("pushbyte.abc", "wb") f.write(abc.serialize()) f.close()