Director text problem (sorry if wrong forum)

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

[AS]member (“pointstotal”).text = global points[/AS]

it gives me an error saying that the variable hasn’t been assigned a value yet.


Please help!


I moved this to other… though it doesnt quite have a place specifically here, its not Flash actionscript for sure :wink:

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.


[color="blue"]global[/color] points [color="red"]-- affects all handlers[/color]
[color="blue"]on[/color] [color="green"]mouseDown[/color] [color="blue"]me[/color]
  [color="green"]member[/color]([color="gray"]"pointstotal"[/color]).[color="green"]text[/color] = points

[color="red"]-- or[/color]
[color="blue"]on[/color] [color="green"]mouseUp[/color] [color="blue"]me[/color]
  [color="blue"]global[/color] someOtherGlobal [color="red"]-- affects only this handler[/color]
  [color="blue"]put[/color] someOtherGlobal

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

Muchos gracias Senocular. You truly are the king of kings.

^Simpsons :beam: