Hello, I would like to have a figure increased whenever a
klick on a defined button is detected. Anywhere on the screen I
would like to have the current value (points collected) displayed
and updated with each correct klick. Whatever I try with string and
variables I do not succeed. Any help please for an example?
1. place a button on the screen (if you are using MX2004 make
sure it's Director's bult-in button and not a flash component by
looking at the toolbox's title in the left. If it reads 'default'
or 'flash component' then click on the down arrow beside the name
and change it from the list that apepars to 'classic'.)
2. place a text or field member on the screen and make sure
to name the member "input" (without quotes).
3. Create a behavior script (below) and attach it to the
-- behavior script on a button
on mouseUp me
val = value(member("input").text)
val = val + 1
member("input").text = string(val)