- Home /
Question by
sillanstudios · Jan 02, 2014 at 05:17 PM ·
animationvariablestringglobal scriptpublic strings
Set a String Global variable value
Hi Everyone,
I was wondering if any one knew how to set a string global variable. I have attempted this:
var myName : String;
function Update(){
if(whatever){
ScriptName.StringVariable = myName;
}
Thanks, I would appreciate the help and will give good ratings :D
Comment
Answer by HappyMoo · Jan 02, 2014 at 06:19 PM
public static var playerName:String;
...
if (whatever)
{
playerName = "the Name";
}
Happy$$anonymous$$oo, noooooooooo, my question. :p, lol just, kidding. First come, first served.
Answer by Spinnernicholas · Jan 02, 2014 at 06:23 PM
You could use a static variable. I'm not sure of how it works exactly in javascript.
public Static string StringVariable;
function Update()
{
if(whatever){
ScriptName.StringVariable = myName;
}
}
Your answer
Follow this Question
Related Questions
Creating an animation with variables? 2 Answers
How to get a value and keep it updated 2 Answers
Using a String in an Enable statement 2 Answers
Will caching strings improve performance for animation? (and other string calls) 1 Answer
C# Variable 4 Answers