i have a button in a symbol, when i release the mouseclick, i want it to add
the value if 1 to a dyn. txt field in another symbol... var name is
"DYNTXTFIELD"
so, if i use:
var DYNTXTFIELD=DYNTXTFIELD+1;
nothing happens.
if i add the path to the variable, i get an error!
**Error** Symbol=Menu, layer=Buttons, frame=88:Line 9: Syntax error.
var _root.Symbol.DYNTXTFIELD=root.Symbol.DYNTXTFIELD+1;
why would such a simple thing be so difficut for flash to do?
does anyone have any ideas how to get what i want to happen, to happen? i cant
find any documentation about this function, one you would think would have come
up often, thanks!
planetfallstudios - 25 Sep 2006 15:18 GMT
well, according to:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14727
"Declare variables with var or set variable. Although Flash does not require
using var or set variable to assign a value to a variable, it's a good
practice...."
Right, thats why it didnt work for me, what did work is :
_root.Symbol.DYNTXTFIELD=root.Symbol.DYNTXTFIELD+1;
notice, the lack of "var"? as suggested by adobe's own documentation...
live and learn.
also, this topic posted twice, with no option to delete my repeated post...
why do you suppose that is?