Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

button title problem



I have a problem setting a buttons title more than once.
I figured it would be quite simple but I just can't seem to find a solution:

I have a text field where one can enter a numeric value.
I want to that value to be added to the value of the button, ie the title of the button, each time it is clicked

hence this code:

on clicked theObject

set cVal to contents of text field "c" of window "main"

set xVal to title of theObject

set newTitle to (xVal + cVal)

set title of theObject to newTitle

end clicked

This works fine, but it only works once ! Wahetever I seem to try, the title of the button seems to be sticked to the initial value, being 0.
If I change cVal, newTitle changes to (0+cVal). When I click again, it remains (0+cVal)

anyone ?


regards

chris
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.