Why doesn’t System.Capabilities class have browser property?

Can someone explain why Adobe put in the feature:

trace(Capabilities.os); // gets the operating system

and not something like

trace(Capabilities.browser); // gets the browser... this property doesn't exist unfortunately...

On a game project I’m working on, the game uses key combinations such as CTRL+Z and CTRL+Y for certain features. Unfortunately, combo keys using CTRL key don’t work in Internet Explorer (but they do work in other browsers). What I want to do is detect if the user has IE, then change the key combinations to SHIFT+Z and SHIFT+Y. The only way to determine the browser is by using a server side language or Javascript to pass in the browser into Flash… grr….

Does anyone know if there’s a way to use ExternalInterface to send the keys? I don’t want to depend on Javascript being on a page or specific Flash vars be sent to the user… but I may have to do so.

Update 10/17/08:

I found a way to detect for IE.

Capabilities.playerType; //Returns ActiveX if in IE. 

A string that indicates the type of player. This property can have one of the following values:

  • "StandAlone" for the Flash StandAlone Player
  • "External" for the Flash Player version used by the external player, or test movie mode..
  • "PlugIn" for the Flash Player browser plug-in
  • "ActiveX" for the Flash Player ActiveX Control used by Microsoft Internet Explorer

AS3 EventManager 1.23: cleanUp method added

A major reason why some users of my EventManager class may see more memory leaks being shown than actual memory leaks is because EventManager stores all the listeners in a dictionary. If we remove a display object then technically (if weakReference is set to true) the listeners are removed for the DisplayObject and its children. Until today, EventManager required coders to manually remove every listener they created with EventManager even if Adobe’s GC actually removed them.

As much as I like the listeners being auto removed, I feel it’s better in practice to manually remove them so you know what’s going on while you code. If you always depend on that to happen then you might find yourself with memory leaks.

I never thought to actually have EventManager check each object to see if it’ll trigger the Event EventManager says it has. Therefore, I added cleanUp which will go through all of the listeners and remove the ones that don’t trigger anymore. This new method means that the EventManager should be more accurate in what’s going on (especially if you call a deepTrace now). It won’t work all the time of course (multiple listeners in one object will still be reported as a leak unless garbage collection takes care of it or you use EventDispatcher’s removeEventListener to remove them).

Anyway, check it out.

Boomshine Flash Game ported to IPhone

Boomshine, my most popular Flash game, has just been released on the Apple ITunes store. You can now download it now on the IPhone or IPod touch.

Jacob Thurman , whose blog current theme is coincidently the same as mine (makes things a bit confusing), is a developer in Chicago who contacted me recently with a prototype. I worked with him to get the game to match the web version as close as possible, and I think he’s done a great job.

As a game designer, I can’t express in words the feeling I get that people will be playing Boomshine on the subway or on the street. It’s funny that the harder I work for opportunities the more they come to me.

Anyway, click here for the download link (will auto-open in ITunes, or if you’re viewing this on your IPhone it’ll launch directly on your IPhone’s store). New features are planned for future versions (global highscores, game modes, etc).

Boomshine will hopefully be the first of many of my game designs to be ported to IPhone.