Posted by pompeyd in SWF Studio V3 on Feb 24 2008, 08:59 am

Hi,

Have come across a strange little bug. I have components which have popups initialised at strartup. Each popup has a different name. I error check every ssCore command for it's success property, and report on any errors.

When the app starts, it starts in minimized mode, and is then 'restored' after everything is initialised.

I have been getting, what looked like, intermittent errors at start up. Error Code 2, Popup Menu Already Exists, and error code 7, Popup Menu ID Already Exists.

I have tracked these down to clicking on the Icon in the Task Bar as the app starts up. If I leave the app alone while starting up, then everything is fine, and the popups are created without any error.

I have worked around this, by starting in hidden mode, and showing the window after initialization, but I was just wondering why clicking on the icon in the taskbar was causing this error? It looks like it is causing my components to initialize twice, and so calling the sequence of calls to ssCore.Popup.* twice.

Is this a bug in SWF Studio, or something I need to take into account in the future? I.E. create my popups elsewhere than in the init() function of the class file?

Thanks

Paul


Posted by northcode in SWF Studio V3 on Feb 24 2008, 11:42 pm

It could be because you're trying to create a popup menu (click on the tray) before your menu has been initialized. The easiest solution I can see would be to add the tray icon in code (Tray.addIcon) instead of specifying it in the IDE. That way you can control when the tray icon appears.