5 entries in 2010

Ideal default Flash IDE setup for Developers

Instructions on how to set up the Flash IDE for hassle-free AS3 development

Wednesday, October 6th, 2010

Flash has a few places where you can set preferences, some of which are saved globally, some of which are saved per file. The per-file settings are a pain as they are forgotten for new files.

This post describes how to:

  • Disable file-specific global warnings, such as migration warnings for onMouseDown
  • Use File > New File > Templates to specify default settings, such as turning off Always declare stage instance

Disabling warnings

I tried the adobe-recommended handler names for about 6 months before reverting back to onMouseDown etc which is  far more readable in both the code and project outline in FlashDevelop. The thing is, Adobe by default in ActionScript 3.0 you get a migration warning on every publish. Annoying!

I’ve finally found out that you can toggle these warnings using the EnabledWarnings.xml file, by simply setting the enabled attribute to false for the desired warning.

The file can be found in the following location:

Win: C:///en/Configuration/ActionScript 3.0/EnabledWarnings.xml
Mac: HD|Applications||Configuration|ActionScript 3.0|EnabledWarnings.xml

There are about 30 warnings in all, covering possible mistakes, coding style, and AS2 to AS3 code migration.

Setting default file / file preference settings

Did you know that it’s possible to create your own file templates, complete with settings found in:

File > Publish Settings... > Flash > ActionScript 3.0 Settings...

This covers:

  • Export classes in frame n
  • Strict mode
  • Warnings mode
  • Automatically declare stage instances

If you simply create a folder called Templates in your user Configuration folder, then a named subfolder, and save an .fla file in there, it appears in the File > New > Templates list.

Not only this, but:

  • The template group shows on the Flash startup screen
  • File > New remembers your choice, so automatically pre-selects the last-used template
  • The File > New > Templates tab, Category and Template choice is remembered between sessions

I now have a folder called Templates/Development, and a few different .fla files in there, all with the settings I mentioned above.

You could easily add some files with default timeline testing code, a few symbols, fonts, etc, as well.

Export/import Outlook 2007 email account settings

Monday, August 30th, 2010

I can’t believe I seem to be the only person on the web to work this one out, but here’s how you export and import email account settings between profiles – for which there is no option within Outlook itself.

First of all, open regedit32.exe from the search box in the start menu.

Then, navigate to this key:

[HKEY_USERS\S-1-5-21-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxx\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\

This should be showing a list of the mail profiles you have on your machine:

regedit-outlook-profile

Navigate slightly further down the tree this time, to the key labelled:

\9375CFF0413111d3B88A00104B2A6676\

This is the key that stores a list of all the email accounts in your Outlook profile:

regedit-outlook-accounts

To transfer these accounts to a different profile, or a different machine, do the following:

  1. export the registry branch 9375… to a new .reg file
  2. open the new file in a text editor
  3. do a find and replace for // substituting the text between the slashes with your new profile name
  4. save the reg file
  5. double-click on the reg file to import it into the registry

If you did everything correctly, and the named profile exists, when you reopen Outlook, and go to Tools > Account settings… you should see your newly imported accounts:

outlook-accounts

It really does appear to be as simple as that. Yay :)

jQuery Deconstructed

An interactive visual breakdown of the jQuery internal code

Monday, July 19th, 2010

UPDATE: jQuery Deconstructed is now JS Libs Deconstructed, also supporting Prototype, and soon, MooTools.

I’ve been interested in the internal structure of jQuery for as long as I can remember, but it can be overwhelming at the best of times, so I’ve recently made-good on my plan to build an interactive breakdown of the physical code.

Essentially, it provides a rather handy birds-eye view of the jQuery library, making it easy to dig into and understand the coding behind the seemingly-simple syntax.

Points of note:

  • It breaks the physical JavaScript into visual blocks that you can easiliy navigate.
  • Each block opens to reveal its internal code
  • Clickable hyperlinks allow you to follow program flow

It now also has a few nice features such as:

  • Live links to the online documentation
  • Color themes
  • Optional icons

Check it out here: https://keyframesandcode.com/resources/javascript/deconstructed/

Excel export delimited text macro

Export Tab-delimited text from Excel

Friday, April 30th, 2010

I often need to save text from Excel to use with PHP, but I find Excel’s “Save As” functionality less that useful, as it converts your open worksheet to a text, which is a real pain.

This macro exports the current worksheet as a tab-delimited or comma-delimited text file, with the following features:

  • optionally exports the current selection
  • outputs values as text
  • strips leading and trailing whitespace
  • quotes any cells with spaces (TSV only)
  • warns if the file is locked

Here’s an example of the two file outputs:

Tab-separated values

id      word    words
1       hello   "hello there"
2       goodbye "goodbye then"
3       a       "a, b, c"

Comma-separated values

id,word,words
1,hello,hello there
2,goodbye,goodby then
3,a,a, b, c

Download ExportDelimitedText

Accurate screen-to-print sizing in Photoshop

Preview millimeter-accurate images on screen without having to continually print test prints.

Thursday, February 11th, 2010

I learnt how to set up Photoshop today so that the screen displays images at the exact same size they will print out, which is great for previewing how your work will look without endless printing and reprinting.

Here’s what you do:

  1. Note the size of your screen height in pixels (mine is 1024)
  2. Measure the physical height of the pixel-area of your screen using a ruler (mine measured 27.0 cm exactly)
  3. Divide the number of pixels by the number of centimetres (1024 / 27 = 37.925)
  4. Enter this number in the Screen Resolution box under Preferences > Units & Rulers:

Photoshop will now display your images at the correct size when you choose View > Print Size.

However, it’s a bit of pain to have to go to the menu option each time, but an easy solution is to simply map View > Print Size to the CTRL + ` (top left key):

keyboard

Now, you can easily swap between 100% and Print Size by alternating between CTRL+1 and CTRL+`