Hello and thanks for clicking
Now while I am not a complete newbie I am far from an expert in this, so instead of using terms I hardly understand myself I'll just give a rough outline of what I need for this project to work
I am currently working on a turn-based point-and-click strategy game in flash. Now like most strategy games gathering resources is important, and in this game there are currently four resource bases, a forest, a gold mine, a lake and a stone mine.
What I need is for the player to be able to click on, for example, the forest, in which case a dynamic text will become visible. Now I need the player to be able to insert an ammount of soldiers. That ammount will be sent to claim the resources of the base. So basically I need the ammount that is typed in the dynamic text to be retracted from the "soldiers" var and added to the var representing the soldiers in the forest.
Any help on how to achieve this would be appreciated
Thanks in advance
What problem are you having getting a value entered to be used? With some form of indication being provided for that text entry (a click of a button), you take the value and utilize it, casting it as a Number or int when doing so. You should show the code that is giving you a problem.
A textfield has a "text" property. So if you have a variable that you want to assign the textfield's entry to, then you assign it using...
yourVariable = textfieldName.text;
If you want that variable to be a Number, then you cast the textfield text as a Number when you assign it to the variable...
yourVariable = Number(textfieldName.text);
Europe, Middle East and Africa