[flexcoders] Re: Examining static variables when debugging with Flash Builder
Strange. It works for me. Maybe you need to initialize x in the constructor of the Global class. Leaving it unassigned may cause that error. --- In flexcoders@yahoogroups.com, William Mitchell whm@... wrote: --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: You have to create a variable of type Global somewhere in your code before you can use the class variable x. valdhor: Thanks for that note. I'd tried to boil the question to its essence. In the real app, various static members of Global are used in various places. However, your note did prompt me to add this field in the application (tos.mxml): public static var global: Global = new Global That produces an interesting result: tos.global.x in the Expressions view shows me the data of interest, giving me a viable workaround. But Global.x in the Expressions view produces the same result: error(s)_during_the_evaluation
[flexcoders] Re: Examining static variables when debugging with Flash Builder
You have to create a variable of type Global somewhere in your code before you can use the class variable x. The Flash Builder compiler is Smart. If you explicitly import a class but then don't use it the compiler will not import the class. To do so would bloat the code for something that is not used. As x is a static variable (ie. class variable) you would need to use the class to get access to x. ie. Global.x After you create the variable you don't need to use that variable. In fact, the variable will be null. Global will not appear in the Variables view as it is not a variable - it is a class. To see x in debug you would need to create an expression - Global.x --- In flexcoders@yahoogroups.com, William Mitchell whm@... wrote: I've got a class like this: package tos.model { public class Global { public static var x:int } } when at a breakpoint in Flash Builder 4.5, I'd like to find out what the value of Global.x is. Global doesn't appear in the Variables view. I've tried adding watches for Global, Global.x, tos.model.Global, and tos.model.Global.x. All produce 'error(s)_during_the_evaluation' in red in the Value column. Any ideas on how I could get a look at Global.x? William Mitchell Research Programmer School of Information: Science, Technology, and Arts The University of Arizona
[flexcoders] Re: Examining static variables when debugging with Flash Builder
--- In flexcoders@yahoogroups.com, valdhor valdhorlists@... wrote: You have to create a variable of type Global somewhere in your code before you can use the class variable x. valdhor: Thanks for that note. I'd tried to boil the question to its essence. In the real app, various static members of Global are used in various places. However, your note did prompt me to add this field in the application (tos.mxml): public static var global: Global = new Global That produces an interesting result: tos.global.x in the Expressions view shows me the data of interest, giving me a viable workaround. But Global.x in the Expressions view produces the same result: error(s)_during_the_evaluation