def get_flash_code_1(basename, path): code = \ '\t\t[Embed(source = "<SPRPATH>")] public static const <SPRVARNAMECAPS>:Class;\n' + \ '\t\t[Embed(source = "<XMLPATH>", mimeType = "application/octet-stream")] public static const <SPRVARNAMECAPS>_XML:Class;\n' + \ '\t\tpublic static var <SPRVARNAME>:SpriteData;\n' path = path[:-6] sprpath = "sprites/" + path.replace(flash_spr_path,"") + ".png" xmlpath = sprpath[:-4] + ".xml" code = code.replace("<SPRPATH>",sprpath) code = code.replace("<XMLPATH>",xmlpath) code = code.replace("<SPRVARNAME>",basename.replace("spr_","")) code = code.replace("<SPRVARNAMECAPS>",basename.upper()) return code
def get_flash_code_2(basename): code = "\t\t\t<VAL> = new SpriteData(SPR_PLAYER_IDLE_XML, <SPR>);" code = code.replace("SPR_PLAYER_IDLE",basename.upper()) code = code.replace("<SPR>",basename.upper()) code = code.replace("<VAL>","Sprites." + basename.replace("spr_","")) return code