View Full Version : Director text problem (sorry if wrong forum)
El Phantom
May 4th, 2003, 07:26 PM
Hey. I'm using Director MX, and I'm trying to set a textboxes value to a global variable I created in a frame script.
The message window shows the variables value when I type in showGlobals, but when I try to use
member ("pointstotal").text = global points
it gives me an error saying that the variable hasn't been assigned a value yet.
:-\
Please help!
--EP
senocular
May 4th, 2003, 07:44 PM
I moved this to other... though it doesnt quite have a place specifically here, its not Flash actionscript for sure ;)
anyway, the global keyword is used to identify a variable as referencing the global value of that variable and not a local one. Defining that identification is independant of expressions and should be done alone, either at the top of the script out of any handlers to affect all handlers within the script or within any specific handler to be specific to only that handler in the script.
example:
global points -- affects all handlers
on mouseDown me
member("pointstotal").text = points
end
-- or
on mouseUp me
global someOtherGlobal -- affects only this handler
put someOtherGlobal
end
after that sincgle identification of the variable as being a global, it can then be used normally as if any other variable and it will reference the correct global value
El Phantom
May 4th, 2003, 08:18 PM
Muchos gracias Senocular. You truly are the king of kings.
^Simpsons :beam:
--EP
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.