Category: Mac

Local Notification ANE – Source Code

I started using Adobe Native Extensions ANE on iOS projects months ago, but then I quickly felt limited because sometimes extensions didn’t do exactly what I wanted and sometimes there was no native extension for some not widely used iOS features. Then I started studying Objective-C to try to overcome these limitations myself. I started by modifying the Daniel Kostler’s Local Notification ANE posted in the Adobe site (see Added Features below).

This post explains how to download the ANE source code and update it if you want to. If you only want to include the ANE in your Flash projects see my next post here.

I know little about Android but yet managed to add some features though not all of them.

Added Features

  • Placed all classes in a new namespace.
  • The NotificationManager.applicationBadgeNumber property allows you to set and get the value of the application icon badge number.
  • The Notification class has three additional properties:
    • fireDate: This property will let you pass a Date object with the date when you want the notification to be triggered.
    • repeatInterval: This property allows you to define a repeat interval between notifications. If no repeat interval is specified it triggers a single time. This property must be set to one of the constants in the NotificationTimeInterval class.
    • soundName: This property specifies a sound file name to play. For the sound to play it must be a wav, aiff or caf sound file using Linear PCM, MA4, µLaw or aLaw format and must be shorter than 30 seconds. It seems AIR is converting from MP3 to the needed formats.
  • The native iOS code was cleaned up. It looks like at the beginning they were trying to support Local as well as Remote(Push) Notifications. But then they just decided to support only Local, and a lot of garbage code was left in there. Besides, this test code was depending on a large library that was not included with the ANE. Without this library the project couldn’t compile.
  • Added a default version of the ANE that does nothing, to allow compiling debug versions on Desktop computers.
  • Documentation updated to reflect the extension additions.

Continue reading “Local Notification ANE – Source Code”

The magnifying effect in the Mac OS X Dock

While I was working I needed to create a button bar that performs more like the Mac OS X Dock using the same magnifying effect. After many tries and many versions later I managed to get the desired effect in Flash, get access to the source code at: In this post I explain the math algorithm I used for this effect.

Idea #1

The first idea was to make icon under the cursor bigger and then start making the surrounding icons smaller and smaller using a linear progression. In the next image you can see how icons were shown using this algorithm.


This algorithm has two problems though:

  1. When and icon grows and shrinks it doesn’t have a smooth movement because of the linear progression.
  2. There is a side-effect in the algorithm that makes icons appear to be shaking. I’ve seen the same movement in a lot of bars of this type so I guess they are using this linear approach. Some others try to soften this movement with and smooth algorithm but the issue is still in there.