Flash, Mac and iPhone stuff
1 Jun
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.

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:
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:
Flash, Macs and Apps - thats pretty much what i'm about.
If you like what you see Digg my stories, and leave a comment. Thanks for looking
Leave a reply
You must be logged in to post a comment.