I have a button and I want to create a counter that show the number of the hits of the button...
You have to use PHP or Perl to save changes into file. See www.flash-db.org There is an example of site counter but you can easily rewrite it into button counter. Best Regards
tnx man...but look... i don't want it to save after the movie closed...
oh then use this script _root.counter = 0; _root.button.onPress = function() { _root.counter++; } Place this script in the stage movie. _root.button is the path to your button. This script will var Counter = 0 and then when Button is pressed Counter will be increaced by 1.
Create Dynamic text field and set its variable to be _root.counter.
k....the dynamic text is workin'....it's show the number 0.... but...in the first script... let say the instance name of the button is: gun what should i change here: _root.counter = 0; _root.button.onPress = function() { _root.counter++; } ?
k....the dynamic text is workin'....it's show the number 0.... but...in the first script... let say that the instance name of the button is: gun what should i change here: _root.counter = 0; _root.button.onPress = function() { _root.counter++; } ?
tnx bro!!!!! it's all working!!! man 10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!!! U REALLY HELPED ME!!!
if your textfield has instance name tbox you can use: _root.counter = 0; _root.yourButton.onPress = function() { _root.counter++; tbox.text=_root.counter;
Don't see what you're looking for? Try a search.
|