Posts Tagged as3

Quick Tip: Set a ComboBox’s dropdown height with rowCount

I looked and looked for a way to change the height of the dropdown list in a ComboBox in AS3. It can be done by setting the rowCount property on the ComboBox.

rowCount defaults to 5, so if you need to make a ComboBox’s list smaller, it’s actually quite easy:

myComboBox.rowCount = 4

That makes sense, but it’s not immediately obvious. I thought I’d put that up here in case anybody else runs into the same thing.

, , , , ,

Leave a comment

Determining whether a SWF is running in the IDE or a browser

Here’s something that’s been around for a while that I didn’t learn about until just recently.

The flash.system.capabilities.playerType property can be used to tell whether you’re running in the browser, a standalone player, or the Flash IDE. It returns the following values (from Adobe’s documentation):

  • “ActiveX” for the Flash Player ActiveX control used by Microsoft Internet Explorer
  • “Desktop” for the Adobe AIR runtime (except for SWF content loaded by an HTML page, which has Capabilities.playerType set to “PlugIn”)
  • “External” for the external Flash Player or in test mode
  • “PlugIn” for the Flash Player browser plug-in (and for SWF content loaded by an HTML page in an AIR application)
  • “StandAlone” for the stand-alone Flash Player

Simply check for (flash.system.capabilities.playerType == "ActiveX" || flash.system.capabilities.playerType == "PlugIn") and you’ll know you’re in a browser.

, , ,

Leave a comment