i have attached my .fla file that have a mc called score and a dynamic text box... i want my dynamic text box to have 0 in it and every time u press the score mc i would like the dynamic text box to increae by 1... why didnt it work for me?
Printable View
i have attached my .fla file that have a mc called score and a dynamic text box... i want my dynamic text box to have 0 in it and every time u press the score mc i would like the dynamic text box to increae by 1... why didnt it work for me?
I hate to be a bother, but I couldnt open the file, perhaps try reattaching it?
-Osteel-
well, there's some errors.
First of all, You cannot name variable and textbox with the same name. It just won't work.
Second, You have to define the textbox.text when you increase the "score".
Third, you must define Score variable before You can use _root.score +=1 in Flash 7.
1)so in the firstframe put
_root.score = 0;
and in then put this code in the movieClip You want to press.
2)
on (release) {
_root.score += 1;
_root.scoretext.text = _root.score;
}
3)
rename the dynamic textbox to scoretext
Awsome... thanks mate
Well, you cannot call the textfield score but the var name of the field could be score...then it would update with _root.score++; ...not the cleanest but it works :D
For your initial example that would mean delete the instance name score, and write score in the var field instead, then init score int the main frame like score = 0; ...cheers