PDA

View Full Version : setstring help



rjmyth
12-04-2010, 10:20 PM
hey guys. having a bit of trouble with changing a text display on flash by using a var string to put into it.

# SetString [Member] [s] [InContext] - Sets the value of a string variable.

* Member - The name of the variable to set the value of.
* s - The string value to set the variable to.
* InContext - The TranslationContext to use when resolving any tags eno****ered in the text.
(lololol the udn page has spelling error in encountered:P)

i have a var string mygfxtext;

the defaultproperty of this string is set to "stuff"

i use FlashText.SetString("Text", ""$mygfxtext);
i also tried without the ""$ bit as i dont properly understand it yet but it doesnt work.

maybe it has something to do iwth this incontext thing if anybody knows what that meants?.

essentially i want to change my variable at certain times and set the onsceen text to it.

i have definately set up the text and font embedding etc etc correctly and everything in the flash is tested and works fine when setting this exact text object to the value of pawns ammo like in the tut, but im trying to alter it for text values instead of numbers.

any help much appreciated ive been trying to figure it out all night.



edit: ok think i solved it by using settext instead of setstring. i assume the string types used by actionscript and unrealscript are different so are incompatible :):). still would be useful to know what incontextmeans.

Matt Doyle
12-06-2010, 10:31 AM
You should be able to make this work simple with:

FlashText.SetString("text", mygfxtext);