Author Archives: ayn

Flash 10 security changes: setClipboard() requires user interaction

This is probably why the click-to-copy share links don’t work with Flash 10:

Setting data on the system Clipboard requires user interaction

In Flash Player 9, ActionScript could set data on the system Clipboard at any time. With Flash Player 10, the System.setClipboard() method may be successfully called only through ActionScript that originates from user interaction. This includes actions such as clicking the mouse or using the keyboard. This user interaction requirement also applies to the new ActionScript 3.0 Clipboard.generalClipboard.setData() and Clipboard.generalClipboard.setDataHandler() methods.
What is impacted?

This change can potentially affect any SWF file that makes use of the System.setClipboard() method. This change affects SWF files of all versions played in Flash Player 10 and later. This change affects all non-application content in Adobe AIR?however, AIR application content itself is unaffected.
What do I need to do?

Any existing content that sets data on the system Clipboard using the System.setClipboard() method outside of an event triggered by user interaction will need to be updated. Setting the Clipboard will now have to be invoked through a button, keyboard shortcut, or some other event initiated by the user.

[From Adobe – Developer Center : Understanding the security changes in Flash Player 10]

new mac Flash player breaks most click-to-copy share links

A couple of days ago I noticed that the click-to-copy-to-clipboard share links at Skitch’s site stopped working. I thought it was because of MultiClutch, a program that gives you multi-touch inputs to all Cocoa programs, I wanted to be able to use 3-finger swipes left and right to navigate back and forward in Firefox. I uninstalled that and the input manager it came with and the click-to-copy links still didn’t work. So I think about it more, and since I know how these click-to-copy links work pretty well, I know that most of them depends on Flash to copy to clipboard, and then it occurred to me that I had upgraded Flash to version 10.

I then downgraded it back to version 9 and the click-to-copy links now all work again. 🙂 So if you’re googling the same problem, check your Flash version (about:plugins), and see if it’s version 10, if so, downgrade it back to 9.

It’s been a year…

We lost Fee-Fee a year ago, we miss him dearly. In the past year, we got Bear, picked up snowboarding, I changed jobs and then switched to consulting full-time, launched a side project, we got new Macs, new phones, went to Asia twice, etc, but we still think about him all the times and we love him and miss him just as much. I remember he carried his pink toy elephant to Washington Square on his own, people always loved it when they saw him with that and often commented on how his toy was almost as big as him. I think I left that toy in the taxi when we got to the emergency hospital. Here’s a photo of him with it at the park:

Fee-Fee playing at WashSq (by AndrewNg.com)

Rails plugin/helper to provide “click to copy text field” (to clipboard)

You often see sites with text fields of share links in various different formats, like Skitch provides links to share the images you skitch, they look like this:

Skitch.com > andrewng > Energy Saver
Uploaded with plasq‘s Skitch!

You often click the text box or a copy button next to it and the content is copied to your clipboard so you can paste it into a tweet, a blog or forum post and what not.

I needed something like this for one of my projects, it is pretty easy to do, and there are things you can use to do this. However there isn’t a super simple way to do this in Rails, maybe it’s so simple that nobody bothered to publish a plugin. Well, just for kicks I’ve created a plugin that lets you do exactly this by using a cilick_to_copy_text_field_tag helper in your views. This plugin requires jQuery or jRails, neither of which is part of standard Rails, but they are pretty easy to add to any Rails project.

The plugin is hosted here: http://github.com/ayn/click_to_copy_text_field/tree/master, the README pretty much tells all you need to know to use it.

Initial impressions of new MacBook Pro

Apple - MacBook Pro
Uploaded with plasq‘s Skitch!

Broke down and walked out from the San Francisco Apple store with a new MacBook Pro, I definitely do not need an upgrade, I got my MBP this Jan. But the unibody is just too sexy, and I have to send in my MBP for repair and I absolutely cannot live without my laptop for a week, so getting a new one allows me to send the old one in for some cosmetic repair (free of charge by Apple), and then I can sell it on eBay. I went with the 2.53GHz version as I do want more memory, bigger hard drive, larger L2 cache.

By now I’m sure you’ve all read the specs countless times and know what the differences are on paper, here are some things you probably won’t find by reading the specs:

  • the keyboard is LOUD, it is much louder than the gapless keyboard on the last generation MBPs and the PowerBooks.
  • the keys of the keyboard has a slight “play”, overall the keyboard doesn’t feel as solid as the Apple Bluetooth or the slim USB keyboards, I actually might even prefer the keyboard on the plastic MacBook to this one. Keep in mind that the machine is only a few hours old so things like this might change with more usage.
  • the glass trackpad is great, it feels better than a used MBP/PB trackpad, but again I’m not sure how it would feel a couple months from now, according to Apple it is supposed to stay this way because of the new material and processes used
  • the machine runs quite a bit cooler, they keyboard and the palm rests don’t feel hot like my old MBP (it is 2 generations old, the last MBP with the old-style keyboard layout).
  • even though the fans run at around the same speed as my old MBP (at around 2k rpm), they are a lot nosier. I could hardly hear the fans on my old MBP at 2k rpm, but I can DEFINITELY hear them on this new one.
  • speed of normal usage (web, mail.app, etc) and web development feels about the same, I fired up Bridge and CS3 and it is a bit snappier.
  • Migration Wizard was able to copy almost everything over, including the stuff in /opt (MacPorts stuff mostly, including my Rails setup). I had to however re-install X Code and Passenger again manually.
  • I would prefer a matte screen but the glossy screen is okay so far, we’ll see how much I hate/like it during the day tomorrow.

Overall I am pretty happy with it. I’m gonna drop off my old MBP at the store to get the top deck replaced, when I get it back it will pretty much be a brand spanking new MBP. Let me know if you want to buy it!