On my stage I have 3 movies, M1, M2 and M3 and a dynamic text box set to show the variable 'txt'.
On my 1st frame I have the actionscript:
Code:
for (j=1; j<=3; j++){
_root["m"+j].onPress=function(){
_root.txt=j;
}
}
What I want to be able to do is to display either the number 1, 2 or 3 DYNAMICALLY in the text box depending on whether M1, M2, or M3 was selected.
The code above will always show '4' in the text box nomatter which movie is selected. (due to the function obviously being called after for loop has finished)
How do I resolve/rewrite this please (it is imperitive that M1-M3 are kept as movie symbols)?
(please note that what I have done here is very a very simlified version of what I am tring to do, however if someone can solve this problem for me, then I can apply the result to my more complex project. Thanks)
Cheers! (P.S an example .fla FLash 8 file is enclosed).