Function not returning the right value


hi, i'm having strange problem , hoping knows how fix it....

i'm trying send string function in class , have return in textfield, can add movieclip , stage. using several buttons.the problem when put string value in returns string value previous call function not string value want use. here's function:

 

public function replacemctxt( mcstring:string, xpos:number,

                                                                                           ypos:number, width:uint, height:uint, newfontsize:uint, rollovertext:boolean = false):textfield {

                                                  var newmctxt:textfield = new textfield();

                                                  newmctxt.x = xpos;

                                                  newmctxt.y = ypos;

                                                  newmctxt.width = width;

                                                  newmctxt.height = height;

                                                  var textformat:textformat = new textformat();

 

                                                  textformat.align = _gamemodel.screenfontalign;

 

                                                  textformat.size = newfontsize;

                                                  textformat.font = _gamemodel.screenfont;

                                                  textformat.color = _gamemodel.screenfontcolor;

                                                  newmctxt.defaulttextformat=textformat;

 

                                                  newmctxt.text = _languageclass.gettranslation(mcstring);

                                                  newmctxt.selectable = false;

                              return newmctxt;

                    }

 

i'm trying call statement in class:

 

_moregamestxtfield = _updatelanguageclass.

                                        replacemctxt("more games", _gamemodel.moregamestxtxpos,

                                                                       _gamemodel.moregamestxtypos, _gamemodel.moregamestxtwidth,

                                                                       _gamemodel.moregamestxtheight, _gamemodel.moregamestxtfontsize);

 

instead of giving me "more games" movieclip gives me "play" movieclip previous call function used. had similar problem in function doing same thing filtering different buttons, think problem in function ,but i'm not enough programmer know is. if has idea please let me know. thank you.....

start investigation using trace() function see value being passed , returned whatever _languageclass.gettranslation() is.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Adobe Acrobat Pro , Terminal Server Use

Thread: transmission-daemon isn't playing nice: "409: Conflict"

Thread: gpg: Conflicting Commands