Need help clearing dynamic text fields and resetting a global number
Hello, I have a till system that calculates the change for a small business that I am working on for my A-Level.
Once an order has been completed I have a button that takes you back to the start of the order process and attemps to clear the dynamic text fields that contain the cost of the order, and the numbers inputted into the calculator. I have used the code txt.text = ""; to try and reset them, but it only makes the text invisible and remains until another cost is entered, while the number inputted to the calculator remains regardless.
Can anybody find out why and how to fix it thanks?
Make sure the actions are on Frame 1 and cover all frames on the root timeline.
This will make sure the same var is used across all the frames.
Also when assigning a type to a var don't use . even though the syntax will pick up the word text it will still think its a paths
so txt.text = ""; is not the same as txt = "";
Without see any code it would be hard to say for sure though its the most likely cause to your issue.
Thanks for the reply.
Removing the .text on the end of the actionscript for the reset button does appear to remove the information from the dynamic boxes, however I am now unable to add anything to these dynamic text boxes in the next order.
The code for the button is as follows.
on (release) {
gotoAndPlay(1);
txt = "";
change1 = "";
cashpaid = "";
}
the txt is for the order display, the change1 is the calculated change dynamic text and the cashpaid is the amount the customer has given, inputted via a number pad.
Could be problem be arising with the global which allows me to add the cost of items to the txt.text - _global.cost= 0.00; ?
Thankyou
Unfortunately the .fla is far too big for the 300kb limit, and the hostign websites are unfortunately blocked by the school system. I will attempt to upload it later on today