SizzlaBlog

Flash, Mac and iPhone stuff

I have recently created a Growl style Flash interface. Firstly if you don’t know what Growl is then it is a notification system for Mac OS X: it allows applications that support Growl to send you notifications.
Smoke Display

Notifications are a way for your applications to provide you with new information, without you having to switch from the application you’re already in.

I decided to create a Flash based version that could be used to show you information about something happening in your application at runtime.

To see what I mean, take a look here, then carry on reading to see how its done.

First things first

Before we get started, this script is in action script 2.0. There will be a 3.0 version coming soon (just as soon as I get a spare 10 minutes).

There are a few things you should be familiar with:

The Tween Class

setInterval

dynamically adding and removing objects from the stage.

For more info why not check out my other site www.flcodr.com where you can find actionscript snippets about the above.

The script!!

At the and of the post is a download for the source files. The zip contains the .fla and .as files. I decided to split them up so you could easily use this with other projects. The example requires the user to click a button to see the notification but this could also be called from another function.

The script is written in such a way that you pass in a few parameters. You can then also call a function after the notification is displayed.

Calling the function

showGrowl(”Hello World!”,36,103,70,2);

The above function will create a notification containing the text “Hello World!”. The other four parameters are the x position, y position, alpha level and duration respectively. That’s it, nice and simple. You can change the size of the notification by editing the movie clip in the library.

The script works by:

  1. Dynamically adding an instance of the movie clip to the stage using the x and y position passed to the function.
  2. Setting the alpha level.
  3. Adding the text as passed in.
  4. Starting a timer with the duration as passed in.
  5. Stopping the timer after the duration.
  6. Fading the notification to 0 using the tween class
  7. Removing the movie clip from the stage

Creating a call back

The script can optionally call a function once the notification has gone. This function should sit within your .fla and be called callBack, as follows:

function callBack(){

//some code here

}

That’s it!! One function call to display the notification, and another to optionally call a function when the growl has gone.

The good bit

So here’s the bit that you really want:

Source Files

Two more great Growl plug-ins

This is just a link for two great plugins for Growl that notify you when there is a change in either Thunderbird or Firefox.

In Thunderbird, Growl displays a notification when new mail is recieved, and in Firefox displays when downloads are complete (clicking on the notification, opens up the download manager).

Growl Plugins for: Thunderbird and Firefox

Hope you enjoy!

  • 0 Comments
  • Filed under: Apps
  • Un-Plugged - plugin for Growl

    Un-Plugged is a nice little app that works in conjunction with Growl to give you a graphical notification of both your battery level and whether or not you external power lead is connected. This is one of those seemingly pointless yet useful apps for your Mac.

    If you haven’t heard of Growl or used it yet, check it out. Its basically a global notification tool that alerts you about application changes (such as when a cd is burnt in Toast). It allows you to apply various themes for each application thats associated with it. For a list of compatible apps, click here.

  • 0 Comments
  • Filed under: Apps