[RESOLVED] subtract number in text field
I have a text field which has a variable theyear assigned to it. The field starts with 2012 in it.
I have a button which has this script attached...
on (release) {
if (Number(theyear)>2003) {
oldyear=theyear;
updatedyear=Number((theyear)-1)
trace(updatedyear)
theyear = updatedyear;
}
}
With previous editions of Flash, each button click would reduce the visible value in the text field.
I am using CS6 now and although the traced variable logs correctly, the display in the text field goes from 2012 to 2011 to 200 and stays that way.
I'm a novice and am stumped. Any help would be appreciated.
Senior Member
Hi, upload your FLA so members can take a look. Might be settings of the TextField or some other overlooked setting.
test file attached
Attached Files
.
Hi,
Try
Actionscript Code:
on ( release) { if ( theyear > 2003 ) { theyear--; trace ( theyear) ; } }
@fruitbeard: much simpler language. thank you.
however, the result is the same.
I'm wondering it's an embedded font issue or some other field restriction I'm unaware of. "2" "0" show up but other individual digits don't.
Senior Member
Ok took a look, and it is a very simple error. You need to embed fonts. When testing things out, i like to set it to Device Fonts so there aren't any problems with text.
Thank you. That was it. I thought I had embedded, but apparently didn't embed everything.
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