Input And Dynamic ActionScript Help Please!
Copy link to clipboard
Copied
Hello. I am a bit of a newbie to flash actionscript and I am trying to do something a little out of my depth. I am trying to make a little system that when you enter a number into an input text section (e.g 3). On the side of the screen, where it originally said had 3 in static text and a 24 in dynamic text next to it. I would like the 24 to go to 23. And if you type in 6 in the input text then 6 24 goes to 6 23. Please help
Copy link to clipboard
Copied
And after going to 23 then 22 and then 21 etc.
Copy link to clipboard
Copied
Can you provide more of the details of what goes on with the input textfield? Can you describe the bigger picture as to what's going on... the purpose?
You are giving the impression that each use of a particular number is kept track of, but over what range of interactivity? Will the user be entering only one number in the input textfield or will it be a series of numbers that get entered at the same time? Are these numbers that are entered retained or cleared with each entry?
Copy link to clipboard
Copied
Ok. Well I am trying to create a system that shows how many of each card is left in a pack of 6 cards. When a 2 is dealt. You type 2 in the input text and the dynamic text next to 2 will decrease by 1. If you type K for a King then the dynamic text for King will decrease by 1.
Copy link to clipboard
Copied
And I just wanna say. This system is just for my personal use. I saw one a while ago and just wondered if I could re-create it. I am not going to use it other than to see if it works. I think it would be good practice for my programming skill
Copy link to clipboard
Copied
Do you have any other way we could talk? This is quite slow
Copy link to clipboard
Copied
Does anyone have anything they can offer me to help???
Copy link to clipboard
Copied
I (and everyone else) offer time here freely... I am otherwise a freelance designer and charge for private consultation. Based on your numerous repostings in such a short timespan, you need to develop your patience skills.
If you bring something to the table other than "I want", such as code that isn't working for you and your own ideas for the design approach, you are likely to get help. You didn't answer all of my questions, so I can't offer much more than the following...
You will need to look into textfield onChanged to determine when something has been entered into the input field and then process whatever was input such that you adjust the dynamic textfield count to be one less. It may be to your advantage to name the dynamic textfield using the characters as part of the name, such as t2, tK, t9, so that when you read that the input field had a particular character entered, you can target the dynamic field directly using that character... as in
this["t"+inputChar].text = Number(this["t"+inputChar].text) - 1;
Copy link to clipboard
Copied
Thank you very much Murphy. The code isn't working. But I will play around with it and try and get it to work with the program
Copy link to clipboard
Copied
I have now inserted the following code to the system.
this["t"+inputChar].text = Number(this["t"+inputChar].text) - 1;
I can see that it will work. But flash isn't recognising when something has been typed into the input text box. Anyone know how to do that? I was thinking of a onKeyDown...
Copy link to clipboard
Copied
I already told you you should look into textfield onChanged. That will detect when the content of a textfield changes. One of the most important skills to develop in Flash is to learn how to use the Help documents and Google to find answers.

