1

I'm working on an Adobe Air Desktop App ATM.

My question is how to get the icon for a given file extension, but without actually loading up a file of such type.

I had the idea to just create a blank file for the extension and then delete it once i have the bitmap for its icon, but that seemed like too much trouble and kinda inefficient.

So for example i want to get the icon associated with a .txt file, or .html file. Is their any way of doing such without having to directly reference and existing file , or create a temporary one as mentioned above?

Larry
  • 239
  • 4
  • 13

2 Answers2

1

Just in case you didn't find this solution by yourself, please have a look at the File class.

It has an "icon" property which may well be just what you're looking for.

Good luck.

David Kroukamp
  • 36,155
  • 13
  • 81
  • 138
  • The documentation URL has changed. Here's an updated URL: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html – claudius iacob Aug 27 '15 at 11:42
0

I ended up just having to do as i though, just create a temporary file on the desktop with the given file extension, open and close a stream to it ( no need to write anything to it ), then i could access its icon. After which i deleted the file, and all was good.

Larry
  • 239
  • 4
  • 13