Passing data to a function help!


i'm in process of modding menu of game , i'm trying enable debugging menu.

 

the menu series of checkpoints, , when select 1 supposed teleported correct location , @ correct point of mission checkpoint.

 

i've managed enable visibility of menu can see , use it, selecting checkpoint on list loads first one.

 

now, know debug checkpoints in game work because have changed script of menu doesn't value of checkpoint load selected menu item, gets preset value. changing preset value allowed me load different checkpoints without issue.

 

so think i've narrowed issue down data not being passed "event handler" function (at least imagine issue?). i've included 2 relevant sections of code below.

 

the function creates each "debug checkpoint" selection on menu:

public function adddebugcheckpoint(param1:string, param2:string, param3:int) : void {     var _loc4_:menuitem = new menuitem(param1,this.debugcheckpointhandler);     _loc4_.description = param2;     _loc4_.data = param3;     this._debugcheckpointsitem.page.additem(_loc4_); } 

 

the "debugcheckpointhandler" function supposed call script load selected checkpoint:

protected function debugcheckpointhandler(param1:menuitemevent) : void {     this.call("jump_to_debug_checkpoint",param1.item.data int); } 

 

i think issue based around data "param1" receiving in "debugcheckpointhandler" function, maybe if it's not getting data it's defaulting 0 because it's set int, hence loading first checkpoint?

 

here's link entire actionscript file. appreciated if me out!

 

thanks!

 

edit: i've done few little tests , think "param1.item.data" isn't returning anything. issue. know why actionscript isn't passing data across?

you should learn how use trace() function follow processing can check see if data going want go.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop