actionscript 3 - Editing a Sprite variable in a SWF With C# -
so trying develop trainer game silly know none less want know how edit sprite variable in action script of game through button , text
// action script... // [initial movieclip action of sprite 2248] #initclip 12 class gamedata { var playerid, playername, lastmodified, difficulty, clevel, money, ammo_total, points; function gamedata(_playername) { var _loc2 = new date(); playerid = string(_loc2.gettime()); playerid = playerid + string(math.round(math.random() * 99999)); playername = _playername; lastmodified = new date(); difficulty = 1; clevel = 1; money = 0; ammo_total = [60000, 0, 0, 0, 0, 0]; points = 0; } // end of function static function savegame(_game) { _global.cgame.lastmodified = new date(); gamedata.savegames(_global.games); } // end of function static function savegames(_games) { var _loc1 = sharedobject.getlocal(gamedata.gameid); _loc1.data.games = _games; _loc1.flush(); } // end of function static function newgame(_name, _difficulty) { var _loc1 = sharedobject.getlocal(gamedata.gameid); var _loc2 = _loc1.data.games; if (_loc2 == undefined) { _loc1.data.games = new array(); } // end if var _loc3 = new gamedata(_name, _difficulty, _loc2.length); _loc1.data.games.push(_loc3); _loc1.flush(); } // end of function static function deletegame(_index) { var _loc1 = sharedobject.getlocal(gamedata.gameid); var _loc2 = _loc1.data.games; if (_index < 0) { return; } // end if if (_index > _loc2.length - 1) { return; } // end if _loc2.splice(_index, 1); _loc1.flush(); } // end of function static function getgames() { var _loc1 = sharedobject.getlocal(gamedata.gameid); var _loc2 = _loc1.data.games; if (_loc2 == undefined) { _loc1.data.games = []; _loc1.flush(); } // end if return (_loc1.data.games); } // end of function static var gameid = "qigames_13daysnightmare_12"; } // end of class #endinitclip
that action script sprite want edit
var _loc2 = new date(); playerid = string(_loc2.gettime()); playerid = playerid + string(math.round(math.random() * 99999)); playername = _playername; lastmodified = new date(); difficulty = 1; clevel = 1; money = 0; ammo_total = [60000, 0, 0, 0, 0, 0]; points = 0;
i decompiled swf , can edit main root or mainmovie button , text box cant seem figure out of change values in sprite
![this how edit root variables } game.setvariable("_root.examplevar", textbox1.text); {][2]
please sorry if explained confusing
i'm not sure did understand meaning or not.but code modifies variables @ runtime swf.but not related c#.hope that's want or can you.
you can modify custom vars or call custom methods @ runtime using bracket syntax :
this["money"]=9999;
this example bracket syntax.
now can this:
function setvalue(e:mouseevent){ this[vartxt.text]=number(valtxt.text); } mybutton.addeventlistener("click",setvalue);
"vartxt" textfield write variable's name , "valtxt" input value variable.
with code,you have custom trainer inside game.or better say, sth console.
hope helps.
Comments
Post a Comment