RE: [flexcoders] CursorManager, PopupManager - internal state across module load?
This is the shared code issue explained in my presentation at 360Flex. You can find out more on my blog at blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of david_mccraw123 Sent: Friday, March 16, 2007 9:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] CursorManager, PopupManager - internal state across module load? Hi, I've run into an issue where, after loading a module, calling CursorManager.setBusyCursor() inside that module causes an exception (Error #1009: Cannot access a property or method of a null object reference). The same happens with Alert.show (in PopupManager.createPopup). First I moved the setBusyCursor() call into a button click(), to be sure the module had loaded completely - but this had no effect. If, however, I call setBusyCursor() then removeBusyCursor() in the /module loader/ mxml file (on ready event), the module button can then also set the cursor without error. Similarly, an Alert in the module loader (on ready event) allows alerts within the module. To muddy the waters further, if I load the module at the start of the application, it works okay - it's just when I re-load it that the error starts occurring. I was hoping someone might have run into a similar problem, or have any pointers toward finding a solution. Thanks, Dave
Re: [flexcoders] CursorManager, PopupManager - internal state across module load?
You must load a reference to CursorManager and Popup Manager in your shell. ie in shell main.mxml import mx.managers.CursorManager private m:CursorManager that should fix it regards Bjorn On 17/03/2007, at 3:51 AM, david_mccraw123 wrote: Hi, I've run into an issue where, after loading a module, calling CursorManager.setBusyCursor() inside that module causes an exception (Error #1009: Cannot access a property or method of a null object reference). The same happens with Alert.show (in PopupManager.createPopup). First I moved the setBusyCursor() call into a button click(), to be sure the module had loaded completely - but this had no effect. If, however, I call setBusyCursor() then removeBusyCursor() in the /module loader/ mxml file (on ready event), the module button can then also set the cursor without error. Similarly, an Alert in the module loader (on ready event) allows alerts within the module. To muddy the waters further, if I load the module at the start of the application, it works okay - it's just when I re-load it that the error starts occurring. I was hoping someone might have run into a similar problem, or have any pointers toward finding a solution. Thanks, Dave