|
-
Senior Member
[help] Whats with my dynamic text box?
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?
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
I hate to be a bother, but I couldnt open the file, perhaps try reattaching it?
-Osteel-
-
Senior Member
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
Last edited by TeroLebe; 09-29-2005 at 09:30 AM.
-
Senior Member
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Elvis...who tha f**k is Elvis?
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 
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
Last edited by phreax; 09-29-2005 at 10:14 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|